View Javadoc
1   package com.github.valfirst.slf4jtest;
2   
3   import org.slf4j.ILoggerFactory;
4   import org.slf4j.IMarkerFactory;
5   import org.slf4j.helpers.BasicMarkerFactory;
6   import org.slf4j.spi.MDCAdapter;
7   import org.slf4j.spi.SLF4JServiceProvider;
8   
9   /**
10   * @author Valery Yatsynovich
11   */
12  public class TestSLF4JServiceProvider implements SLF4JServiceProvider {
13      public static final String REQUESTED_API_VERSION = "2.0.99";
14  
15      private ILoggerFactory loggerFactory;
16      private IMarkerFactory markerFactory;
17      private MDCAdapter mdcAdapter;
18  
19      @Override
20      public void initialize() {
21          loggerFactory = TestLoggerFactory.getInstance();
22          markerFactory = new BasicMarkerFactory();
23          mdcAdapter = new TestMDCAdapter();
24      }
25  
26      @Override
27      public ILoggerFactory getLoggerFactory() {
28          return loggerFactory;
29      }
30  
31      @Override
32      public IMarkerFactory getMarkerFactory() {
33          return markerFactory;
34      }
35  
36      @Override
37      public MDCAdapter getMDCAdapter() {
38          return mdcAdapter;
39      }
40  
41      @Override
42      public String getRequestedApiVersion() {
43          return REQUESTED_API_VERSION;
44      }
45  }