[slf4j-dev] [JIRA] Updates for SLF4J-592: Mechanism for indicating provider to use for unit tests.

slf4j developers list slf4j-dev at qos.ch
Mon Nov 6 20:05:00 UTC 2023


SLF4J / SLF4J-592 [Resolved]
Mechanism for indicating provider to use for unit tests.

==============================

Here's what changed in this issue in the last few minutes.


There is 1 comment.


View or comment on issue using this link
https://jira.qos.ch/browse/SLF4J-592

==============================
 1 comment
------------------------------

Garret Wilson on 06/Nov/23 19:53

[~ceki] I want to say thanks for the discussion here on how to have different logging implementations for unit tests. You've marked this ticket as a duplicate of SLF4J-450. That's fine, although I would say that SLF4J-450 is one possible way to address this larger issue. In fact I want to step back and reevaluate what I was trying to do in the beginning and give a summary for the record.

I opened this ticket because I wanted to see any log output of my unit tests to {{stdout}}. At least I thought I did. But upon reflection I don't want to see all that logging stuff in the output of my Maven build. what I  _really_ want is to _disable_ the logging for unit tests, but somehow easily turn them on arbitrarily when I'm debugging my unit tests. Disabling the output is easy—sort of: I can just do nothing, and SLF4J will fall back to a NOP provider, but it will still show some ugly logging. It turns out I can play some tricks with SLF4J-450 to get around that. And to arbitrarily turn on logging to {{stdout}}, again I can play some tricks with SLF4J-450. So in the end I think {{SLF4J-450}} will allow me to do what I (discovered that I really) want to do, and I'll wind up taking {{slf4j-simple}} out of my root POM altogether.

I'm going to implement this in my [Clogr](https://clogr.io/) library. I'll come back and add one more update here to explain how it all fits together. Note that 


==============================
 This message was sent by Atlassian Jira (v9.6.0#960000-sha1:a3ee8af)



More information about the slf4j-dev mailing list