Skip to content

jv-logger-solution: configure logger, add appenders, add replace todos with loggers#1233

Open
taraselnik wants to merge 2 commits into
mate-academy:masterfrom
taraselnik:jv-logger-solution
Open

jv-logger-solution: configure logger, add appenders, add replace todos with loggers#1233
taraselnik wants to merge 2 commits into
mate-academy:masterfrom
taraselnik:jv-logger-solution

Conversation

@taraselnik
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Great job on implementing the logger and replacing the standard output calls! Your solution is very close to complete. However, one change is needed to fully meet the requirements.

In AuthenticationServiceImpl.java, the debug message for the login() method should be more informative. Currently, it logs the user ID after the user is found, but for effective debugging, it's better to log the input parameters. This helps trace exactly what the method was called with, which is crucial if an error occurs.

Please update the log message to include the login parameter, as suggested in the checklist [CHECKLIST ITEM #3]. For example: LOGGER.debug("Method login was called. Params: login={}", login);.

Once you make this adjustment, your solution will be perfect. Keep up the excellent work!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

public User login(String login, String password) throws AuthenticationException {
//TODO: add corresponding log message about method login was called
User user = findByLogin(login);
LOGGER.debug("Method login was called for user Id {}", user.getUserId());
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates checklist item #3: 'Let's make our log messages informative'. The example suggests logging the method parameters. It would be more helpful for debugging to log the login parameter here, for instance: LOGGER.debug("Method login was called. Params: login={}", login);.

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Excellent work on this task! I am approving your solution. You've successfully addressed all the previous feedback and met every requirement. The transition from standard output to a logger is well-executed, with informative log messages throughout the application. The .gitignore file is also correctly configured. Great job, keep up the fantastic work!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants