-
Notifications
You must be signed in to change notification settings - Fork 3k
Correct use of static logger in quarkus code #48432
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
Correct use of static logger in quarkus code #48432
Conversation
Status for workflow
|
I wonder if we should ban the use of that logger in our code... |
I think that's a really good idea. I've accidentally introduced it in at least two PRs, possibly more. |
Should that ban extend to extensions as well? Out of curiosity, since I haven't followed the issue, what's the problem with using Log in Quarkus? The fact that it's relying on Quarkus itself to do its work, thus introducing potential deadlocks / unwanted recursion? |
Quarkus' Log only works on code that can be bytecode transformed, which excludes Quarkus code. |
Extensions should also follow the same principal, but we don't control them (and don't even have the same maven plugins that we use in this repo configured in the template generator) |
Something to be added to the extension guide, then. |
I initially thought putting it in the guide was a good idea, but now I'm less sure. If we put it in the extension guide, would people see it at the right point? And if we put it in the logging guide, it clutters up user-facing content with extension-author-content (and people still might not see it at the right point). If it genuinely won't work, static analysis and a build-time failure seem more appropriate. |
It's so easy to call the
Log
methods, but we can't rely on bytecode manipulation in our own code.