1 package org.slf4j.nop; 2 3 import org.slf4j.ILoggerFactory; 4 import org.slf4j.IMarkerFactory; 5 import org.slf4j.helpers.BasicMarkerFactory; 6 import org.slf4j.helpers.NOPLoggerFactory; 7 import org.slf4j.helpers.NOPMDCAdapter; 8 import org.slf4j.spi.MDCAdapter; 9 import org.slf4j.spi.SLF4JServiceProvider; 10 11 public class NOPServiceProvider implements SLF4JServiceProvider { 12 13 /** 14 * Declare the version of the SLF4J API this implementation is compiled against. 15 * The value of this field is modified with each major release. 16 */ 17 // to avoid constant folding by the compiler, this field must *not* be final 18 public static String REQUESTED_API_VERSION = "2.0.99"; // !final 19 20 private final ILoggerFactory loggerFactory = new NOPLoggerFactory(); 21 private final IMarkerFactory markerFactory = new BasicMarkerFactory(); 22 private final MDCAdapter mdcAdapter = new NOPMDCAdapter(); 23 getLoggerFactory()24 public ILoggerFactory getLoggerFactory() { 25 return loggerFactory; 26 } 27 getMarkerFactory()28 public IMarkerFactory getMarkerFactory() { 29 return markerFactory; 30 } 31 getMDCAdapter()32 public MDCAdapter getMDCAdapter() { 33 return mdcAdapter; 34 } 35 36 @Override getRequestedApiVersion()37 public String getRequestedApiVersion() { 38 return REQUESTED_API_VERSION; 39 } 40 initialize()41 public void initialize() { 42 43 } 44 45 46 } 47