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.void
log()
After the logging event is built, performs actual logging.void
NOP implementation that does nothing.void
NOP implementation that does nothing.void
NOP implementation that does nothing.void
NOP implementation that does nothing.void
NOP 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 LoggingEventBuilder
Returns the singleton instance of this class.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
addMarker
in interfaceLoggingEventBuilder
- Parameters:
marker
- a Marker instance to add.- Returns:
-
addArgument
NOP implementation that does nothing.
- Specified by:
addArgument
in 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:
addArgument
in 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:
arg
in 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:
arg
in interfaceLoggingEventBuilder
- Parameters:
b
- a value of typeboolean
value 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:
arg
in interfaceLoggingEventBuilder
- Parameters:
c
- a value of typechar
value 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:
arg
in interfaceLoggingEventBuilder
- Parameters:
b
- a value of typebyte
value 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:
arg
in interfaceLoggingEventBuilder
- Parameters:
s
- a value of typeshort
value 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:
arg
in interfaceLoggingEventBuilder
- Parameters:
i
- a value of typeint
value 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:
arg
in interfaceLoggingEventBuilder
- Parameters:
l
- a value of typelong
value 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:
arg
in interfaceLoggingEventBuilder
- Parameters:
f
- a value of typefloat
value 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:
arg
in interfaceLoggingEventBuilder
- Parameters:
d
- a value of typefloat
value to add.- Returns:
- a LoggingEventBuilder, usually this.
- Since:
- 2.1.0
-
addKeyValue
NOP implementation that does nothing.- Specified by:
addKeyValue
in 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:
kv
in 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:
addKeyValue
in 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:
kv
in 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:
kv
in interfaceLoggingEventBuilder
- Parameters:
key
- the key of the key value pair.b
- the value of typeboolean
of the key value pair.- Returns:
- a LoggingEventBuilder, usually this.
-
kv
NOP implementation that does nothing.- Specified by:
kv
in interfaceLoggingEventBuilder
- Parameters:
key
- the key of the key value pair.c
- the value of typechar
of the key value pair.- Returns:
-
kv
NOP implementation that does nothing.- Specified by:
kv
in interfaceLoggingEventBuilder
- Parameters:
key
- the key of the key value pair.b
- the value of typebyte
of the key value pair.- Returns:
-
kv
NOP implementation that does nothing.- Specified by:
kv
in interfaceLoggingEventBuilder
- Parameters:
key
- the key of the key value pair.s
- the value of typeshort
of the key value pair.- Returns:
-
kv
NOP implementation that does nothing.- Specified by:
kv
in interfaceLoggingEventBuilder
- Parameters:
key
- the key of the key value pair.i
- the value of typeint
of the key value pair.- Returns:
-
kv
NOP implementation that does nothing.- Specified by:
kv
in interfaceLoggingEventBuilder
- Parameters:
key
- the key of the key value pair.l
- the value of typelong
of the key value pair.- Returns:
-
kv
NOP implementation that does nothing.- Specified by:
kv
in interfaceLoggingEventBuilder
- Parameters:
key
- the key of the key value pair.f
- the value of typefloat
of the key value pair.- Returns:
-
kv
NOP implementation that does nothing.- Specified by:
kv
in interfaceLoggingEventBuilder
- Parameters:
key
- the key of the key value pair.d
- the value of typedouble
of the key value pair.- Returns:
-
setCause
NOP implementation that does nothing.- Specified by:
setCause
in interfaceLoggingEventBuilder
- Parameters:
cause
- a throwable- Returns:
-
log
Description copied from interface:LoggingEventBuilder
After the logging event is built, performs actual logging. This method must be called for logging to occur. If the call toLoggingEventBuilder.log()
is omitted, aLoggingEvent
will be built but no logging will occur.- Specified by:
log
in interfaceLoggingEventBuilder
-
setMessage
NOP implementation that does nothing.- Specified by:
setMessage
in interfaceLoggingEventBuilder
- Parameters:
message
- the message of the event- Returns:
-
setMessage
NOP implementation that does nothing.- Specified by:
setMessage
in interfaceLoggingEventBuilder
- Parameters:
messageSupplier
- supplies a String to be used as the message for the event- Returns:
-
log
NOP implementation that does nothing.- Specified by:
log
in interfaceLoggingEventBuilder
- Parameters:
message
- the message to log
-
log
NOP implementation that does nothing.- Specified by:
log
in interfaceLoggingEventBuilder
- Parameters:
messageSupplier
- a Supplier returning a message of type String
-
log
NOP implementation that does nothing.- Specified by:
log
in 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:
log
in 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:
log
in interfaceLoggingEventBuilder
- Parameters:
message
- the message to logargs
- a list (actually an array) of arguments to be used with the message to log
-