slf4j-test icon indicating copy to clipboard operation
slf4j-test copied to clipboard

LoggingEvent should accept a null message

Open quidryan opened this issue 9 years ago • 2 comments

Other Slf4j implementations accept a null for the message when logging. I believe the slf4j API also doesn't label the message as @Nonnull.

Currently LoggingEvent has a checkNotNull check on message. Which causes my existing code, that does log a null, to get an NPE. I think it was probably done to be like the checks on the other Optional fields.

quidryan avatar Apr 13 '16 00:04 quidryan

Since MessageFormatter supports null, I think it's safe to just remove the checkNotNull.

quidryan avatar Apr 13 '16 00:04 quidryan

This is pretty annoying because the test logger's behaviour is different to the actual logger.

nicktindall avatar Jul 04 '18 03:07 nicktindall