Top Description Fields Constructors Methods
org.slf4j.spi

public Class NOPLoggingEventBuilder

extends Object
implements LoggingEventBuilder
Class Inheritance
All Implemented Interfaces
org.slf4j.spi.LoggingEventBuilder
Imports
java.util.function.Supplier, org.slf4j.Marker, org.slf4j.event.Level

A no-operation implementation of LoggingEventBuilder.

As the name indicates, the method in this class do nothing, except when a return value is expected in which case a singleton, i.e. the unique instance of this class is returned.

Author
Ceki Gülcü
Since
2.0.0

Field Summary

Modifier and TypeField and Description
pack-priv static final NOPLoggingEventBuilder

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public LoggingEventBuilder
addArgument(Object p)

Implements org.slf4j.spi.LoggingEventBuilder.addArgument.

Add an argument to the event being built.

public LoggingEventBuilder
addArgument(Supplier<?> objectSupplier)

Implements org.slf4j.spi.LoggingEventBuilder.addArgument.

Add an argument supplier to the event being built.

public LoggingEventBuilder
addKeyValue(String key, Object value)

Implements org.slf4j.spi.LoggingEventBuilder.addKeyValue.

Add a key value pair to the event being built.

public LoggingEventBuilder
addKeyValue(String key, Supplier<Object> value)

Implements org.slf4j.spi.LoggingEventBuilder.addKeyValue.

Add a key value pair to the event being built.

public LoggingEventBuilder
addMarker(Marker marker)

Implements org.slf4j.spi.LoggingEventBuilder.addMarker.

A marker to the event being built.

public void
log()

Implements org.slf4j.spi.LoggingEventBuilder.log.

After the logging event is built, performs actual logging.

public void
log(String message)

Implements org.slf4j.spi.LoggingEventBuilder.log.

Equivalent to calling setMessage(String) followed by log();

public void
log(Supplier<String> messageSupplier)

Implements org.slf4j.spi.LoggingEventBuilder.log.

Equivalent to calling setMessage(Supplier) followed by log()

public void
log(String message, Object arg)

Implements org.slf4j.spi.LoggingEventBuilder.log.

Equivalent to calling setMessage(String) followed by addArgument(Object)} and then log()

public void
log(String message, Object arg0, Object arg1)

Implements org.slf4j.spi.LoggingEventBuilder.log.

Equivalent to calling setMessage(String) followed by two calls to addArgument(Object) and then log()

public void
log(String message, Object... args)

Implements org.slf4j.spi.LoggingEventBuilder.log.

Equivalent to calling setMessage(String) followed by zero or more calls to addArgument(Object) (depending on the size of args array) and then log()

public LoggingEventBuilder
setCause(Throwable cause)

Implements org.slf4j.spi.LoggingEventBuilder.setCause.

Set the cause for the logging event being built.

public LoggingEventBuilder
setMessage(String message)

Implements org.slf4j.spi.LoggingEventBuilder.setMessage.

Sets the message of the logging event.

public LoggingEventBuilder
setMessage(Supplier<String> messageSupplier)

Implements org.slf4j.spi.LoggingEventBuilder.setMessage.

Sets the message of the event via a message supplier.

public static LoggingEventBuilder

Returns:

the singleton instance of this class
singleton
()

Returns the singleton instance of this class.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

SINGLETONback to summary
pack-priv static final NOPLoggingEventBuilder SINGLETON

Constructor Detail

NOPLoggingEventBuilderback to summary
private NOPLoggingEventBuilder()

Method Detail

addArgumentback to summary
public LoggingEventBuilder addArgument(Object p)

Implements org.slf4j.spi.LoggingEventBuilder.addArgument.

Doc from org.slf4j.spi.LoggingEventBuilder.addArgument.

Add an argument to the event being built.

Annotations
@Override
addArgumentback to summary
public LoggingEventBuilder addArgument(Supplier<?> objectSupplier)

Implements org.slf4j.spi.LoggingEventBuilder.addArgument.

Doc from org.slf4j.spi.LoggingEventBuilder.addArgument.

Add an argument supplier to the event being built.

Annotations
@Override
addKeyValueback to summary
public LoggingEventBuilder addKeyValue(String key, Object value)

Implements org.slf4j.spi.LoggingEventBuilder.addKeyValue.

Doc from org.slf4j.spi.LoggingEventBuilder.addKeyValue.

Add a key value pair to the event being built.

Annotations
@Override
addKeyValueback to summary
public LoggingEventBuilder addKeyValue(String key, Supplier<Object> value)

Implements org.slf4j.spi.LoggingEventBuilder.addKeyValue.

Doc from org.slf4j.spi.LoggingEventBuilder.addKeyValue.

Add a key value pair to the event being built.

Annotations
@Override
addMarkerback to summary
public LoggingEventBuilder addMarker(Marker marker)

Implements org.slf4j.spi.LoggingEventBuilder.addMarker.

Doc from org.slf4j.spi.LoggingEventBuilder.addMarker.

A marker to the event being built.

Annotations
@Override
logback to summary
public void log()

Implements org.slf4j.spi.LoggingEventBuilder.log.

Doc from org.slf4j.spi.LoggingEventBuilder.log.

After the logging event is built, performs actual logging. This method must be called for logging to occur. If the call to log() is omitted, a LoggingEvent will be built but no logging will occur.

Annotations
@Override
logback to summary
public void log(String message)

Implements org.slf4j.spi.LoggingEventBuilder.log.

Doc from org.slf4j.spi.LoggingEventBuilder.log.

Equivalent to calling setMessage(String) followed by log();

Annotations
@Override
logback to summary
public void log(Supplier<String> messageSupplier)

Implements org.slf4j.spi.LoggingEventBuilder.log.

Doc from org.slf4j.spi.LoggingEventBuilder.log.

Equivalent to calling setMessage(Supplier) followed by log()

Annotations
@Override
logback to summary
public void log(String message, Object arg)

Implements org.slf4j.spi.LoggingEventBuilder.log.

Doc from org.slf4j.spi.LoggingEventBuilder.log.

Equivalent to calling setMessage(String) followed by addArgument(Object)} and then log()

Annotations
@Override
logback to summary
public void log(String message, Object arg0, Object arg1)

Implements org.slf4j.spi.LoggingEventBuilder.log.

Doc from org.slf4j.spi.LoggingEventBuilder.log.

Equivalent to calling setMessage(String) followed by two calls to addArgument(Object) and then log()

Annotations
@Override
logback to summary
public void log(String message, Object... args)

Implements org.slf4j.spi.LoggingEventBuilder.log.

Doc from org.slf4j.spi.LoggingEventBuilder.log.

Equivalent to calling setMessage(String) followed by zero or more calls to addArgument(Object) (depending on the size of args array) and then log()

Annotations
@Override
setCauseback to summary
public LoggingEventBuilder setCause(Throwable cause)

Implements org.slf4j.spi.LoggingEventBuilder.setCause.

Doc from org.slf4j.spi.LoggingEventBuilder.setCause.

Set the cause for the logging event being built.

Annotations
@Override
setMessageback to summary
public LoggingEventBuilder setMessage(String message)

Implements org.slf4j.spi.LoggingEventBuilder.setMessage.

Doc from org.slf4j.spi.LoggingEventBuilder.setMessage.

Sets the message of the logging event.

Annotations
@Override
setMessageback to summary
public LoggingEventBuilder setMessage(Supplier<String> messageSupplier)

Implements org.slf4j.spi.LoggingEventBuilder.setMessage.

Doc from org.slf4j.spi.LoggingEventBuilder.setMessage.

Sets the message of the event via a message supplier.

Annotations
@Override
singletonback to summary
public static LoggingEventBuilder singleton()

Returns the singleton instance of this class. Used by makeLoggingEventBuilder(Level).

Returns:LoggingEventBuilder

the singleton instance of this class