Mahoney / slf4j-test

Implementation of SLF4J which allows easy access to logging events in tests
39 stars 24 forks source link

LoggingEvent should accept a null message #11

Open quidryan opened 8 years ago

quidryan commented 8 years ago

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 commented 8 years ago

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

nicktindall commented 6 years ago

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