-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reworked ability to disable initializing Slf4J #9185
Conversation
6140ca5
to
8671f41
Compare
The PR includes several breaking API changes which will have to be corrected first plus the tests are failing |
…ble_log_2 # Conflicts: # core/src/main/java/io/micronaut/core/io/scan/DefaultClassPathResourceLoader.java # inject/src/main/java/io/micronaut/context/env/AbstractPropertySourceLoader.java # inject/src/main/java/io/micronaut/context/env/PropertySourcePropertyResolver.java
@graemerocher Need to return methods |
4ab68b2
to
1ec5466
Compare
@graemerocher tests fixed. Also fixed several checkstyle errors, doclint errors and fixed 2 tests for windows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also needs test coverage for the case this is trying to fix
Unfortunately, the previous solution didn't work because the static fields were still initialized regardless of usage.
This solution is much more efficient and works 100% because I tested it several times :). Now, if necessary, the logEnabled flag is set in the constructor and the logger is not static, but is created through the factory only if necessary. Otherwise, a dummy logger is created.
Thus, the code remains as it was and we have the opportunity to turn off the initialization of slf4j in micronaut-openapi.
This solution also corrects the names of loggers when inheriting. Now the child and parent methods use a single logger with the name of the child class (this cannot be done when you have a static logger)