[slf4j-dev] NOPLogger methods are final?

Ceki Gülcü listid at qos.ch
Sat Feb 24 16:47:51 CET 2007


At 10:41 PM 2/15/2007, Eric Crahen wrote:

>The Logger and Marker APIs are actually quite lengthy and its more than a 
>few lines of code to implement them. To write the test above I had to 
>create a NullLogger and implement 49 methods that did nothing; which the 
>NOPLogger already does (attached). I don't see any value in keeping the 
>methods of NOPLogger final.

Using an IDE like Eclipse, you can write a NOP implementation faster than 
you can blink an eyelid.
Just create any class implementing the org.slf4j.Logger interface and let 
Eclipse generate the methods for you. You can also chose to extend 
org.slf4j.impl.MarkerIgnoringBase (org.slf4j.helpers.MarkerIgnoringBase in 
SLF4J 1.3) if you wish the generated class to be smaller.

Does this help?
>- Eric

-- 
Ceki Gülcü
Logback: The reliable, generic, fast and flexible logging framework for Java.
http://logback.qos.ch




More information about the slf4j-dev mailing list