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