-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Logging with Panache #10929
Comments
/cc @loicmathieu |
@FroMage continuing from #13510: my prototype implementation of this idea (https://github.com/Ladicek/quarkus/commits/logging-experiment) indeed scans all classes in the application, which is a waste of resources. The scanning is minimal, but it's still extra work -- one that Jandex already does, because it already scans all classes. In other words, I totally agree with you, we need to get constant pool entries into Jandex :-) (I also still need to implement the transformation from the static calls to virtual calls properly, which requires some stack shuffling. The ASM API is very picky about who its friends are :-) ) |
Great news. If you have some time, could you get smallrye/jandex#84 unstuck by measuring index size changes with the patch to some common quarkus extensions or sample applications? |
I can do that, sure. FYI, I got into this because I wanted to play with something interesting for a bit, so this isn't my top priority. But I should be able to dedicate a few hours here and there to it. |
Great news. I think this is a big UX win if we get this done. |
Just FTR, I have mostly finished the bytecode transformation in my branch, the only thing that needs finalizing is how to best declare the logger field. So I'll get to the Jandex work next. |
I've just assigned this to myself, because I submitted a draft PR: #14586. |
ATM this is how everyone must set up logging:
Which has the same problem as CDI in terms of requiring you to get out of your method, go up to find where to define statics, remember the magic incantation, and then figure out where you wanted to call it. It ruins the movie.
But unlike CDI injection, logging is something that happens super extra often. This is why a lot of people go for
System.err.println
rather than logging during dev, because it's so much easier.Let's fix this.
I'd like to make it so this:
is turned into the previous example by bytecode transformation. We should be able to optimise this like we optimise other transformations by checking if the class has a quarkus marker and has
QuarkusLogger
in its constant pool.I hope this ease of use will lead to more people leaving logging info in their code after debugging, resulting in better logging, as opposed to all
println
being just removed after debugging, never replaced with proper logging.WDYT?
The text was updated successfully, but these errors were encountered: