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
Use slf4j over old logging APIs in Maven #337
Comments
Necessary to fix #201 |
Please let me know if you'd accept a PR for this. |
Sorry for the delay, I was travelling and had PTO in recent weeks. Thanks for the proposal and for being ready to contribute. I agree with the idea and I prefer the Please use the place holders ( The only issue I can think of related to this change is that this will potentially change the logger names for the existing log messages. I do not think it should prevent us from doing this. In the end, I'll bump the major with the next release for other reasons. |
LicenseMojoUtils
LicenseMojoUtils
LicenseMojoUtils
LicenseMojoUtils
Fix #337 Use slf4j over old logging APIs in Maven
Change the code to use slf4j loggers everywhere.
Reasons:
If we used the underlying slf4j logging framework directly, every part of the code could use the same logger type and everyone could ask for a logger (right now, you have to have it injected via Plexus or call getLog() in the Mojo), eliminating the need to get loggers and then pass them around.
Changes: Get a logger using this code at the top of a class which needs logging:
or using
Note: The latter is slightly faster but if you forget to replace the type name, the logger will have the wrong name.
Additional advantage: If you enable logger names in the log output, you can find places where some message was logged much more quickly.
The text was updated successfully, but these errors were encountered: