4 ms·
If you use a closure that capture some local variables and not a constant lambda, then you're right, the allocation will kill you. But, we are only using lambda
by _old_dude_ 9y ago
If you use a closure that capture some local variables and not a constant lambda, then you're right, the allocation will kill you.
But, we are only using lambdas that do not capture anything so the lambda is allocated once by the VM.
And we are using the new shiny System.Logger [1] so the VM logs and the application logs are interleaved. We still have some wrappers to redirect log4j logs on the system logger because few third party libs are compatible with the system logger.
[1] https://docs.oracle.com/javase/9/docs/api/java/lang/System.Logger.html https://docs.oracle.com/javase/9/docs/api/java/lang/System.L...
- sk5t 9y agoAh, makes sense. On the other hand, this would seem to take a StringBuilder-based approach off the table (cf. logback). I wonder how this stacks up to simply passing varargs to the logger. There's also the question of applying any strategy other than toString to the non-string args.