[slf4j-user] Fail Silently on NOP implementation

Ceki Gulcu ceki at qos.ch
Fri Apr 29 11:41:08 UTC 2016



On 4/29/2016 13:03, Phillip Lord wrote:
> Ceki Gulcu <ceki at qos.ch> writes:
>>
>> Robert, I agree with you. The distinction of library vs. application
>> is essential to the problem at hand.
>
>
> I think that things have got a little side-tracked by this discussion
> really. The problem at hand is whether a library should *by default*
> print to standard out/err even in the absence of an error condition.
>
> I think it should not.
>
> I do acknowledge the bootstrap difficulty this causes for SLF4J, but
> there are solutions. The issue of library vs. application only comes
> into question when we discuss the problem with your solution (i.e bind
> to nop).

OK, admittedly, I am assuming that there is a distinction between
library vs. application, a distinction although natural to me might not
always be natural to others.

FYI, I added the following paragraph to 
http://www.slf4j.org/codes.html#StaticLoggerBinder

   If you are packaging an application and you do not care about logging,
   then placing slf4j-nop.jar on the class path of your application will
   get rid of this warning message. Note that embedded components such as
   libraries or frameworks should not declare a dependency on any SLF4J
   binding but only depend on slf4j-api. When a library declares a
   compile-time dependency on a SLF4J binding, it imposes that binding on
   the end-user, thus negating SLF4J's purpose.

In any case, thank you for initiating and valiantly pursuing this
discussion. Such design questions are quite fundamental.


--
Ceki


More information about the slf4j-user mailing list