fix: Remove TempLoggerWrapper and use slf4j-jdk14 as the logging implementation.#157
fix: Remove TempLoggerWrapper and use slf4j-jdk14 as the logging implementation.#157sunyuhan1998 wants to merge 3 commits intoa2aproject:mainfrom
TempLoggerWrapper and use slf4j-jdk14 as the logging implementation.#157Conversation
…ault logging implementation. To enable proper log output, you need to specify the following JVM parameter before running:
`-Djava.util.logging.config.file=src/test/resources/logging.properties`
Signed-off-by: Sun Yuhan <sunyuhan1998@users.noreply.github.com>
Signed-off-by: Sun Yuhan <sunyuhan1998@users.noreply.github.com>
There was a problem hiding this comment.
Summary of Changes
Hello @sunyuhan1998, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request addresses issue #94 by removing the TempLoggerWrapper and switching to slf4j-jdk14 as the logging implementation. This change requires a specific JVM argument to be set for tests to function correctly, which the author acknowledges may be cumbersome.
Highlights
- Logging Implementation: Replaces the custom
TempLoggerWrapperwithslf4j-jdk14for logging, routing SLF4J output tojava.util.logging. - Dependency Management: Adds
slf4j-jdk14dependency topom.xmlandsdk-server-common/pom.xml. - Quarkus Arc Exclusions: Adds exclusions for
jboss-logging,jboss-logmanager,jboss-threads, andslf4j-jboss-logmanagerwhen usingquarkus-arcinsdk-server-common/pom.xml. - Configuration Requirement: Specifies the need for the JVM argument
-Djava.util.logging.config.file=src/test/resources/logging.propertiesfor tests due tojava.util.logginglimitations.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Code Review
This pull request successfully removes the custom TempLoggerWrapper and integrates slf4j-jdk14 as the logging implementation, which is a positive step towards using standard logging practices. The changes in the pom.xml files correctly manage the dependencies and exclusions necessary for this transition, especially within a Quarkus environment. The addition of logging.properties for java.util.logging configuration is also appropriate. My primary feedback addresses the author's concern regarding the cumbersomeness of specifying the JVM argument for tests, suggesting a maven-surefire-plugin configuration to automate this process and enhance developer experience.
…tion. Signed-off-by: Sun Yuhan <sunyuhan1998@users.noreply.github.com>
|
To be honest, as mentioned in the issue #140, I don't know why the unit test failed either — it works fine locally. |
|
@sunyuhan1998 the failure is a known issue #140 |
Okay, that does seem a bit strange. I tried running the unit test class that caused the failure locally, but it ran fine multiple times on my machine. |
|
Yeah, I've not had time to figure it out. It is very strange |
|
Thank you. Since this is more getting output for tests, I think we can go with your simpler approach in #158. So I will close this one :-) |
Hi @kabir , as we discussed previously: #94. This PR removes the
TempLoggerWrapperand usesslf4j-jdk14(which routes SLF4J log output tojava.util.logging) as the default logging implementation.Due to the limitations of
java.util.logging, in order to use it, you must specify the JVM argument:-Djava.util.logging.config.file=src/test/resources/logging.propertiesbefore running each test class.To be honest, I don't really recommend this approach, because it's just too cumbersome.
I would recommend the approach shown in: #158 instead.
Fixes #94
Update: Thanks to Gemini's suggestion! This configuration item is now automatically specified through the maven-surefire-plugin.