001package org.slf4j.spi;
002
003import java.util.function.Supplier;
004
005import org.slf4j.Marker;
006
007/**
008 * A no-operation implementation of {@link LoggingEventBuilder}. 
009 * As the name indicates, this implementation does nothing or alternatively returns
010 * a singleton, i.e. the unique instance of this class.
011 * 
012 * @author Ceki Gülcü
013 * @since 2.0.0
014 *
015 */
016public class NOPLoggingEventBuilder implements LoggingEventBuilder {
017
018    static final NOPLoggingEventBuilder SINGLETON = new NOPLoggingEventBuilder();
019
020    
021    private NOPLoggingEventBuilder() {
022    }
023    
024    public static LoggingEventBuilder singleton() {
025        return SINGLETON;
026    }
027
028    @Override
029    public LoggingEventBuilder addMarker(Marker marker) {
030        return singleton();
031    }
032
033    @Override
034    public LoggingEventBuilder addArgument(Object p) {
035        return singleton();
036    }
037
038    @Override
039    public LoggingEventBuilder addArgument(Supplier<?> objectSupplier) {
040        return singleton();
041    }
042
043    @Override
044    public LoggingEventBuilder addKeyValue(String key, Object value) {
045        return singleton();
046    }
047
048    @Override
049    public LoggingEventBuilder addKeyValue(String key, Supplier<Object> value) {
050        return singleton();
051    }
052
053    @Override
054    public LoggingEventBuilder setCause(Throwable cause) {
055        return singleton();
056    }
057
058    @Override
059    public void log(String message) {
060
061    }
062
063    @Override
064    public void log(Supplier<String> messageSupplier) {
065    }
066
067    @Override
068    public void log(String message, Object arg) {
069    }
070
071    @Override
072    public void log(String message, Object arg0, Object arg1) {
073    }
074
075    @Override
076    public void log(String message, Object... args) {
077
078    }
079
080}