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