diff options
Diffstat (limited to 'slf4j-nop/src/main/java/org/slf4j/nop/NOPServiceProvider.java')
-rwxr-xr-x | slf4j-nop/src/main/java/org/slf4j/nop/NOPServiceProvider.java | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/slf4j-nop/src/main/java/org/slf4j/nop/NOPServiceProvider.java b/slf4j-nop/src/main/java/org/slf4j/nop/NOPServiceProvider.java new file mode 100755 index 00000000..515cf23b --- /dev/null +++ b/slf4j-nop/src/main/java/org/slf4j/nop/NOPServiceProvider.java @@ -0,0 +1,46 @@ +package org.slf4j.nop; + +import org.slf4j.ILoggerFactory; +import org.slf4j.IMarkerFactory; +import org.slf4j.helpers.BasicMarkerFactory; +import org.slf4j.helpers.NOPLoggerFactory; +import org.slf4j.helpers.NOPMDCAdapter; +import org.slf4j.spi.MDCAdapter; +import org.slf4j.spi.SLF4JServiceProvider; + +public class NOPServiceProvider implements SLF4JServiceProvider { + + /** + * Declare the version of the SLF4J API this implementation is compiled against. + * The value of this field is modified with each major release. + */ + // to avoid constant folding by the compiler, this field must *not* be final + public static String REQUESTED_API_VERSION = "2.0.99"; // !final + + private final ILoggerFactory loggerFactory = new NOPLoggerFactory(); + private final IMarkerFactory markerFactory = new BasicMarkerFactory(); + private final MDCAdapter mdcAdapter = new NOPMDCAdapter(); + + public ILoggerFactory getLoggerFactory() { + return loggerFactory; + } + + public IMarkerFactory getMarkerFactory() { + return markerFactory; + } + + public MDCAdapter getMDCAdapter() { + return mdcAdapter; + } + + @Override + public String getRequestedApiVersion() { + return REQUESTED_API_VERSION; + } + + public void initialize() { + + } + + +} |