Class NOPLoggingEventBuilder
- All Implemented Interfaces:
LoggingEventBuilder
A no-operation implementation of LoggingEventBuilder.
As the name indicates, the methods in this class do nothing. In case a return value is expected, a singleton, i.e. the unique instance of this class, is returned.
Note that the default implementations of Logger.atTrace(), Logger.atDebug() , Logger.atInfo(),
Logger.atWarn() and Logger.atError(), return an instance of NOPLoggingEventBuilder
when the relevant level is disabled for current logger. This is the core optimization in the SLF4J fluent API.
- Since:
- 2.0.0
- Author:
- Ceki Gülcü
-
Method Summary
Modifier and TypeMethodDescriptionNOP implementation that does nothing.addArgument(Supplier<?> objectSupplier) NOP implementation that does nothing and thus skips calling get() call on the object supplier.addKeyValue(String key, Object value) NOP implementation that does nothing.addKeyValue(String key, Supplier<Object> value) NOP implementation that doesnothing.NOP implementation that does nothing.arg(boolean b) NOP implementation that does nothing and thus skips the type cast.arg(byte b) NOP implementation that does nothing and thus skips the type cast.arg(char c) NOP implementation that does nothing and thus skips the type cast.arg(double d) NOP implementation that does nothing and thus skips the type cast.arg(float f) NOP implementation that does nothing and thus skips the type cast.arg(int i) NOP implementation that does nothing and thus skips the type cast.arg(long l) NOP implementation that does nothing and thus skips the type cast.arg(short s) NOP implementation that does nothing and thus skips the type cast.NOP implementation that does nothing and thus skips calling get() call on the object supplier.NOP implementation that does nothing.NOP implementation that does nothing.NOP implementation that does nothing.NOP implementation that does nothing.NOP implementation that does nothing.NOP implementation that does nothing.NOP implementation that does nothing.NOP implementation that does nothing.NOP implementation that doesnothing.NOP implementation that doesnothing.voidlog()After the logging event is built, performs actual logging.voidNOP implementation that does nothing.voidNOP implementation that does nothing.voidNOP implementation that does nothing.voidNOP implementation that does nothing.voidNOP implementation that does nothing.NOP implementation that does nothing.setMessage(String message) NOP implementation that does nothing.setMessage(Supplier<String> messageSupplier) NOP implementation that does nothing.static LoggingEventBuilderReturns the singleton instance of this class.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.slf4j.spi.LoggingEventBuilder
arg
-
Method Details
-
singleton
Returns the singleton instance of this class. Used by
makeLoggingEventBuilder(Level).- Returns:
- the singleton instance of this class
-
addMarker
NOP implementation that does nothing.
- Specified by:
addMarkerin interfaceLoggingEventBuilder- Parameters:
marker- a Marker instance to add.- Returns:
-
addArgument
NOP implementation that does nothing.
- Specified by:
addArgumentin interfaceLoggingEventBuilder- Parameters:
p-- Returns:
- a LoggingEventBuilder, usually this.
- Since:
- 2.1.0
-
addArgument
NOP implementation that does nothing and thus skips calling get() call on the object supplier.
- Specified by:
addArgumentin interfaceLoggingEventBuilder- Parameters:
objectSupplier-- Returns:
- a LoggingEventBuilder, usually this.
- Since:
- 2.1.0
-
arg
NOP implementation that does nothing and thus skips calling get() call on the object supplier.
- Specified by:
argin interfaceLoggingEventBuilder- Parameters:
objectSupplier-- Returns:
- a LoggingEventBuilder, usually this.
- Since:
- 2.1.0
-
arg
NOP implementation that does nothing and thus skips the type cast.
- Specified by:
argin interfaceLoggingEventBuilder- Parameters:
b- a value of typebooleanvalue to add.- Returns:
- a LoggingEventBuilder, usually this.
- Since:
- 2.1.0
-
arg
NOP implementation that does nothing and thus skips the type cast.
- Specified by:
argin interfaceLoggingEventBuilder- Parameters:
c- a value of typecharvalue to add.- Returns:
- a LoggingEventBuilder, usually this.
- Since:
- 2.1.0
-
arg
NOP implementation that does nothing and thus skips the type cast.
- Specified by:
argin interfaceLoggingEventBuilder- Parameters:
b- a value of typebytevalue to add.- Returns:
- a LoggingEventBuilder, usually this.
- Since:
- 2.1.0
-
arg
NOP implementation that does nothing and thus skips the type cast.
- Specified by:
argin interfaceLoggingEventBuilder- Parameters:
s- a value of typeshortvalue to add.- Returns:
- a LoggingEventBuilder, usually this.
- Since:
- 2.1.0
-
arg
NOP implementation that does nothing and thus skips the type cast.
- Specified by:
argin interfaceLoggingEventBuilder- Parameters:
i- a value of typeintvalue to add.- Returns:
- a LoggingEventBuilder, usually this.
- Since:
- 2.1.0
-
arg
NOP implementation that does nothing and thus skips the type cast.
- Specified by:
argin interfaceLoggingEventBuilder- Parameters:
l- a value of typelongvalue to add.- Returns:
- a LoggingEventBuilder, usually this.
- Since:
- 2.1.0
-
arg
NOP implementation that does nothing and thus skips the type cast.
- Specified by:
argin interfaceLoggingEventBuilder- Parameters:
f- a value of typefloatvalue to add.- Returns:
- a LoggingEventBuilder, usually this.
- Since:
- 2.1.0
-
arg
NOP implementation that does nothing and thus skips the type cast.
- Specified by:
argin interfaceLoggingEventBuilder- Parameters:
d- a value of typefloatvalue to add.- Returns:
- a LoggingEventBuilder, usually this.
- Since:
- 2.1.0
-
addKeyValue
NOP implementation that does nothing.- Specified by:
addKeyValuein interfaceLoggingEventBuilder- Parameters:
key- the key of the key value pair.value- the value of the key value pair.- Returns:
- a LoggingEventBuilder, usually this.
-
kv
NOP implementation that doesnothing.- Specified by:
kvin interfaceLoggingEventBuilder- Parameters:
key- the key of the key value pair.value- the value of the key value pair.- Returns:
- a LoggingEventBuilder, usually this.
-
addKeyValue
NOP implementation that doesnothing.- Specified by:
addKeyValuein interfaceLoggingEventBuilder- Parameters:
key- the key of the key value pair.value- a supplier of a value for the key value pair.- Returns:
- a LoggingEventBuilder, usually this.
-
kv
NOP implementation that doesnothing.- Specified by:
kvin interfaceLoggingEventBuilder- Parameters:
key- the key of the key value pair.value- a supplier of a value for the key value pair.- Returns:
- a LoggingEventBuilder, usually this.
-
kv
NOP implementation that does nothing.- Specified by:
kvin interfaceLoggingEventBuilder- Parameters:
key- the key of the key value pair.b- the value of typebooleanof the key value pair.- Returns:
- a LoggingEventBuilder, usually this.
-
kv
NOP implementation that does nothing.- Specified by:
kvin interfaceLoggingEventBuilder- Parameters:
key- the key of the key value pair.c- the value of typecharof the key value pair.- Returns:
-
kv
NOP implementation that does nothing.- Specified by:
kvin interfaceLoggingEventBuilder- Parameters:
key- the key of the key value pair.b- the value of typebyteof the key value pair.- Returns:
-
kv
NOP implementation that does nothing.- Specified by:
kvin interfaceLoggingEventBuilder- Parameters:
key- the key of the key value pair.s- the value of typeshortof the key value pair.- Returns:
-
kv
NOP implementation that does nothing.- Specified by:
kvin interfaceLoggingEventBuilder- Parameters:
key- the key of the key value pair.i- the value of typeintof the key value pair.- Returns:
-
kv
NOP implementation that does nothing.- Specified by:
kvin interfaceLoggingEventBuilder- Parameters:
key- the key of the key value pair.l- the value of typelongof the key value pair.- Returns:
-
kv
NOP implementation that does nothing.- Specified by:
kvin interfaceLoggingEventBuilder- Parameters:
key- the key of the key value pair.f- the value of typefloatof the key value pair.- Returns:
-
kv
NOP implementation that does nothing.- Specified by:
kvin interfaceLoggingEventBuilder- Parameters:
key- the key of the key value pair.d- the value of typedoubleof the key value pair.- Returns:
-
setCause
NOP implementation that does nothing.- Specified by:
setCausein interfaceLoggingEventBuilder- Parameters:
cause- a throwable- Returns:
-
log
Description copied from interface:LoggingEventBuilderAfter the logging event is built, performs actual logging. This method must be called for logging to occur. If the call toLoggingEventBuilder.log()is omitted, aLoggingEventwill be built but no logging will occur.- Specified by:
login interfaceLoggingEventBuilder
-
setMessage
NOP implementation that does nothing.- Specified by:
setMessagein interfaceLoggingEventBuilder- Parameters:
message- the message of the event- Returns:
-
setMessage
NOP implementation that does nothing.- Specified by:
setMessagein interfaceLoggingEventBuilder- Parameters:
messageSupplier- supplies a String to be used as the message for the event- Returns:
-
log
NOP implementation that does nothing.- Specified by:
login interfaceLoggingEventBuilder- Parameters:
message- the message to log
-
log
NOP implementation that does nothing.- Specified by:
login interfaceLoggingEventBuilder- Parameters:
messageSupplier- a Supplier returning a message of type String
-
log
NOP implementation that does nothing.- Specified by:
login interfaceLoggingEventBuilder- Parameters:
message- the message to logarg- an argument to be used with the message to log
-
log
NOP implementation that does nothing.- Specified by:
login interfaceLoggingEventBuilder- Parameters:
message- the message to logarg0- first argument to be used with the message to logarg1- second argument to be used with the message to log
-
log
NOP implementation that does nothing.- Specified by:
login interfaceLoggingEventBuilder- Parameters:
message- the message to logargs- a list (actually an array) of arguments to be used with the message to log
-