Code Room
Code reviewMediumcr-g541
Subject Code reviewLevel Mid–Senior~16 minCommon in Code quality & review interviewsIndustries Software development

Question

Review this Java login handler's logging.

What a strong answer looks like

Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix — specific and kind.

Talk through your review
Code to reviewjava
Response login(LoginRequest req) {    log.info("Login attempt: {}", req);  // req.toString() includes all fields    User u = userService.authenticate(req.getEmail(), req.getPassword());    if (u == null) {        log.warn("Failed login for {} with password {}", req.getEmail(), req.getPassword());        return Response.unauthorized();    }    log.info("Issued token {} for {}", u.getSessionToken(), u.getEmail());    return Response.ok(u.getSessionToken());}
Run or narrate your approach, then ask the coach.