feature/logger#1231
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
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
| @Override | ||
| public Order completeOrder(Long userId) { | ||
| // TODO: add log message about method completeOrder was called | ||
| logger.info("completeOrder method was called"); |
There was a problem hiding this comment.
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()); |
There was a problem hiding this comment.
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.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
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! ✨
No description provided.