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

Allowing message field to be null to match SLF4J behavior

Open quidryan opened this issue 9 years ago • 4 comments

(not really documented in Slf4j)

Quick stab at fixing #11. Comments welcome.

quidryan avatar Apr 13 '16 06:04 quidryan

Hi,

Thanks for this.

I was trying to follow a philosophy of never storing or exposing null, so always using Optional where a value could be absent, so this fix would break that pattern.

On the other hand this fix is backwards compatible, whereas changing getMessage() on LoggingEvent to return Optional<String> would be a breaking change (though hopefully not a terribly arduous one if people are comparing events using the static helper constructors).

I'll think about what to do; possibly apply this change as a bug fix release to the 1.2 branch and make the breaking change in a 2.0 release.

Mahoney avatar Apr 19 '16 09:04 Mahoney

+1

nicktindall avatar Jul 04 '18 03:07 nicktindall

Any hope of getting this merged and getting a new release of slf4j-test out?

neeme-praks-sympower avatar May 19 '23 09:05 neeme-praks-sympower

Please check out https://github.com/valfirst/slf4j-test

valfirst avatar May 19 '23 11:05 valfirst