Source Code for SLF4J Simple Logging

SLF4J Simple Logging is a simple logging library that implements the SLF4J API.

Here is the source code for SLF4J Simple Logging 2.0.4. You can download its pre-compiled version slf4j-simple-2.0.4.jar at SLF4J Download Website.

✍:

org/slf4j/simple/SimpleServiceProvider.java

package org.slf4j.simple;

import org.slf4j.ILoggerFactory;
import org.slf4j.IMarkerFactory;
import org.slf4j.helpers.BasicMarkerFactory;
import org.slf4j.helpers.NOPMDCAdapter;
import org.slf4j.spi.MDCAdapter;
import org.slf4j.spi.SLF4JServiceProvider;

public class SimpleServiceProvider 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 ILoggerFactory loggerFactory;
    private IMarkerFactory markerFactory;
    private MDCAdapter mdcAdapter;

    public ILoggerFactory getLoggerFactory() {
        return loggerFactory;
    }

    @Override
    public IMarkerFactory getMarkerFactory() {
        return markerFactory;
    }

    @Override
    public MDCAdapter getMDCAdapter() {
        return mdcAdapter;
    }

    @Override
    public String getRequestedApiVersion() {
        return REQUESTED_API_VERSION;
    }

    @Override
    public void initialize() {

        loggerFactory = new SimpleLoggerFactory();
        markerFactory = new BasicMarkerFactory();
        mdcAdapter = new NOPMDCAdapter();
    }

}

org/slf4j/simple/SimpleServiceProvider.java

 

Or download all of them as a single archive file:

File name: slf4j-simple-2.0.4-sources.jar
File size: 12080 bytes
Release date: 2022-11-17
Download 

 

Source Code for SLF4J Bridge to JDK

SLF4J API Source Code

Downloading and Reviewing SLF4J Packages

⇑⇑ SLF4J - Simple Logging Facade for Java

2021-11-30, 2428👍, 0💬