-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Fluent logging of primitive types #375
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
Comments
Related to #367 |
@Webbot99 Thank you for this report. SLF4J 2.1.0-alpha0 to be released within the next few days will add default See the changes to |
See the changes to |
Been 15 months now since my request! You created a fix within days. But it seems to be held up by other stuff around java versions which are irrelevant to my request. I Know that here is an Alpha release but we can't use it in production. |
When using LoggingEventBuilder to
addArgument
oraddKeyValue
the only parameter options are Object or Supplier. If I use any primitive type (boolean, char, byte, short, int, long, float, double) then the compiler autoboxes them, even when the specified log level is not enabled and the Nop builder then discards them. This can generate a lot of eden garbage. This is an issue for me as I am working on a high throughput, garbage free, app which deals primarily in primitive types.Adding these variants as additional methods eg
addKeyValue("Foo", 1.23d)
etc would delay the auto boxing until when, and only when, the logging is going to output something.Currently the only surefire way to avoid this is to wrap such logging within an
is<Level>Enabled
block.The text was updated successfully, but these errors were encountered: