001package org.slf4j.nop; 002 003import org.slf4j.ILoggerFactory; 004import org.slf4j.IMarkerFactory; 005import org.slf4j.helpers.BasicMarkerFactory; 006import org.slf4j.helpers.NOPLoggerFactory; 007import org.slf4j.helpers.NOPMDCAdapter; 008import org.slf4j.spi.MDCAdapter; 009import org.slf4j.spi.SLF4JServiceProvider; 010 011public class NOPServiceProvider implements SLF4JServiceProvider { 012 013 /** 014 * Declare the version of the SLF4J API this implementation is compiled against. 015 * The value of this field is modified with each major release. 016 */ 017 // to avoid constant folding by the compiler, this field must *not* be final 018 public static String REQUESTED_API_VERSION = "2.0.99"; // !final 019 020 private final ILoggerFactory loggerFactory = new NOPLoggerFactory(); 021 private final IMarkerFactory markerFactory = new BasicMarkerFactory(); 022 private final MDCAdapter mdcAdapter = new NOPMDCAdapter(); 023 024 public ILoggerFactory getLoggerFactory() { 025 return loggerFactory; 026 } 027 028 public IMarkerFactory getMarkerFactory() { 029 return markerFactory; 030 } 031 032 public MDCAdapter getMDCAdapter() { 033 return mdcAdapter; 034 } 035 036 @Override 037 public String getRequestedApiVersion() { 038 return REQUESTED_API_VERSION; 039 } 040 041 public void initialize() { 042 043 } 044 045 046}