Skip to content

feature/logger#1231

Open
Krupkolllia wants to merge 8 commits into
mate-academy:masterfrom
Krupkolllia:feature/logger
Open

feature/logger#1231
Krupkolllia wants to merge 8 commits into
mate-academy:masterfrom
Krupkolllia:feature/logger

Conversation

@Krupkolllia
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 throughout the project. However, some changes are needed in src/main/java/mate/academy/service/OrderServiceImpl.java to fully meet the requirements.

The log messages in your methods are not informative enough because they don't include relevant parameters, which violates one of the task's checklist items [CHECKLIST ITEM #3]. For instance, in the completeOrder and getAllProductsFromShoppingCart methods, the log messages should include the userId to provide better context for debugging.

Please update these log messages to include the method parameters, for example: logger.info("completeOrder method was called for userId={}", userId);. Once you've made these adjustments, your solution will be ready!


✨ 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

@Override
public Order completeOrder(Long userId) {
// TODO: add log message about method completeOrder was called
logger.info("completeOrder method was called");
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 log message should include the method parameters to be useful. In this case, you should include the userId.

Product xiaomi = new Product("Xiaomi 12", BigDecimal.valueOf(499));
List<Product> products = List.of(iphone, macBook, xiaomi);
// TODO: add log message about successful fetched data from DB
logger.info("Successfully fetched {} products from DB", products.size());
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

To make this log message more informative, consider including the userId parameter from the getAllProductsFromShoppingCart method. This would provide more context about which user's products are being fetched.

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 revision! You've successfully addressed all the previous feedback by making the log messages much more informative and including relevant parameters. The logger is now implemented correctly throughout the project, and all requirements have been fully met. I am approving your solution. Great job!


✨ 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