sysout-over-slf4j icon indicating copy to clipboard operation
sysout-over-slf4j copied to clipboard

Logger prints wrong line numbers

Open Jukka-A opened this issue 5 years ago • 0 comments

I noticed that when printing System.out or System.err the line numbers are incorrect in the final log message. The incorrect line numbers comes from LogLevel class where the message is given to logger.

In SLF4JPrintStreamDelegate ClassOrigin.getCallOrigin could also easily resolve the correct line number. SLF4J logger cannot take in line number, but we could put it in front of message for example. It could be customizable feature how to add line number to message or format message. This requires new interface to sysout-over-slf4j which user could implement.

Even some indication in the log message about the wrong line number would help.

Jukka-A avatar May 29 '19 07:05 Jukka-A