Class SubstituteLogger
- All Implemented Interfaces:
Logger
NOPLogger. However, a different delegate can be set at any time.
See also the relevant error code documentation.
- Author:
- Chetan Mehrotra, Ceki Gulcu
-
Field Summary
FieldsFields inherited from interface org.slf4j.Logger
ROOT_LOGGER_NAME -
Constructor Summary
ConstructorsConstructorDescriptionSubstituteLogger(String name, Queue<SubstituteLoggingEvent> eventQueue, boolean createdPostInitialization) -
Method Summary
Modifier and TypeMethodDescriptionatDebug()Entry point for fluent-logging forLevel.DEBUGlevel.atError()Entry point for fluent-logging forLevel.ERRORlevel.atInfo()Entry point for fluent-logging forLevel.INFOlevel.Make a newLoggingEventBuilderinstance as appropriate for this logger and the desiredLevelpassed as parameter.atTrace()Entry point for fluent-logging forLevel.TRACElevel.atWarn()Entry point for fluent-logging forLevel.WARNlevel.voidLog a message at the DEBUG level.voidLog a message at the DEBUG level according to the specified format and argument.voidLog a message at the DEBUG level according to the specified format and arguments.voidLog a message at the DEBUG level according to the specified format and arguments.voidLog an exception (throwable) at the DEBUG level with an accompanying message.voidLog a message with the specific Marker at the DEBUG level.voidThis method is similar toLogger.debug(String, Object)method except that the marker data is also taken into consideration.voidThis method is similar toLogger.debug(String, Object...)method except that the marker data is also taken into consideration.voidThis method is similar toLogger.debug(String, Object, Object)method except that the marker data is also taken into consideration.voidThis method is similar toLogger.debug(String, Throwable)method except that the marker data is also taken into consideration.delegate()Return the delegate logger instance if set.booleanvoidLog a message at the ERROR level.voidLog a message at the ERROR level according to the specified format and argument.voidLog a message at the ERROR level according to the specified format and arguments.voidLog a message at the ERROR level according to the specified format and arguments.voidLog an exception (throwable) at the ERROR level with an accompanying message.voidLog a message with the specific Marker at the ERROR level.voidThis method is similar toLogger.error(String, Object)method except that the marker data is also taken into consideration.voidThis method is similar toLogger.error(String, Object...)method except that the marker data is also taken into consideration.voidThis method is similar toLogger.error(String, Object, Object)method except that the marker data is also taken into consideration.voidThis method is similar toLogger.error(String, Throwable)method except that the marker data is also taken into consideration.getName()Return the name of thisLoggerinstance.inthashCode()voidLog a message at the INFO level.voidLog a message at the INFO level according to the specified format and argument.voidLog a message at the INFO level according to the specified format and arguments.voidLog a message at the INFO level according to the specified format and arguments.voidLog an exception (throwable) at the INFO level with an accompanying message.voidLog a message with the specific Marker at the INFO level.voidThis method is similar toLogger.info(String, Object)method except that the marker data is also taken into consideration.voidThis method is similar toLogger.info(String, Object...)method except that the marker data is also taken into consideration.voidThis method is similar toLogger.info(String, Object, Object)method except that the marker data is also taken into consideration.voidThis method is similar toLogger.info(String, Throwable)method except that the marker data is also taken into consideration.booleanIs the logger instance enabled for the DEBUG level?booleanisDebugEnabled(Marker marker) Similar toLogger.isDebugEnabled()method except that the marker data is also taken into account.booleanbooleanbooleanbooleanisEnabledForLevel(Level level) Returns whether this Logger is enabled for a givenLevel.booleanIs the logger instance enabled for the ERROR level?booleanisErrorEnabled(Marker marker) Similar toLogger.isErrorEnabled()method except that the marker data is also taken into consideration.booleanIs the logger instance enabled for the INFO level?booleanisInfoEnabled(Marker marker) Similar toLogger.isInfoEnabled()method except that the marker data is also taken into consideration.booleanIs the logger instance enabled for the TRACE level?booleanisTraceEnabled(Marker marker) Similar toLogger.isTraceEnabled()method except that the marker data is also taken into account.booleanIs the logger instance enabled for the WARN level?booleanisWarnEnabled(Marker marker) Similar toLogger.isWarnEnabled()method except that the marker data is also taken into consideration.voidlog(LoggingEvent event) makeLoggingEventBuilder(Level level) Make a newLoggingEventBuilderinstance as appropriate for this logger implementation.voidsetDelegate(Logger delegate) Typically called after theLoggerFactoryinitialization phase is completed.voidLog a message at the TRACE level.voidLog a message at the TRACE level according to the specified format and argument.voidLog a message at the TRACE level according to the specified format and arguments.voidLog a message at the TRACE level according to the specified format and arguments.voidLog an exception (throwable) at the TRACE level with an accompanying message.voidLog a message with the specific Marker at the TRACE level.voidThis method is similar toLogger.trace(String, Object)method except that the marker data is also taken into consideration.voidThis method is similar toLogger.trace(String, Object...)method except that the marker data is also taken into consideration.voidThis method is similar toLogger.trace(String, Object, Object)method except that the marker data is also taken into consideration.voidThis method is similar toLogger.trace(String, Throwable)method except that the marker data is also taken into consideration.voidLog a message at the WARN level.voidLog a message at the WARN level according to the specified format and argument.voidLog a message at the WARN level according to the specified format and arguments.voidLog a message at the WARN level according to the specified format and arguments.voidLog an exception (throwable) at the WARN level with an accompanying message.voidLog a message with the specific Marker at the WARN level.voidThis method is similar toLogger.warn(String, Object)method except that the marker data is also taken into consideration.voidThis method is similar toLogger.warn(String, Object...)method except that the marker data is also taken into consideration.voidThis method is similar toLogger.warn(String, Object, Object)method except that the marker data is also taken into consideration.voidThis method is similar toLogger.warn(String, Throwable)method except that the marker data is also taken into consideration.
-
Field Details
-
createdPostInitialization
-
-
Constructor Details
-
SubstituteLogger
public SubstituteLogger(String name, Queue<SubstituteLoggingEvent> eventQueue, boolean createdPostInitialization)
-
-
Method Details
-
getName
-
makeLoggingEventBuilder
Description copied from interface:LoggerMake a new
LoggingEventBuilderinstance as appropriate for this logger implementation. This default implementation always returns a new instance ofDefaultLoggingEventBuilder.This method is intended to be used by logging systems implementing the SLF4J API and not by end users.
Also note that a
LoggingEventBuilderinstance should be built for all levels, independently of the level argument. In other words, this method is an unconditional constructor for theLoggingEventBuilderappropriate for this logger implementation.- Specified by:
makeLoggingEventBuilderin interfaceLogger- Parameters:
level- desired level for the event builder- Returns:
- a new
LoggingEventBuilderinstance as appropriate for this logger
-
atLevel
Description copied from interface:LoggerMake a newLoggingEventBuilderinstance as appropriate for this logger and the desiredLevelpassed as parameter. If this Logger is disabled for the given Level, then aNOPLoggingEventBuilderis returned.- Specified by:
atLevelin interfaceLogger- Parameters:
level- desired level for the event builder- Returns:
- a new
LoggingEventBuilderinstance as appropriate for this logger
-
isEnabledForLevel
Description copied from interface:LoggerReturns whether this Logger is enabled for a givenLevel.- Specified by:
isEnabledForLevelin interfaceLogger- Parameters:
level-- Returns:
- true if enabled, false otherwise.
-
isTraceEnabled
Description copied from interface:LoggerIs the logger instance enabled for the TRACE level?- Specified by:
isTraceEnabledin interfaceLogger- Returns:
- True if this Logger is enabled for the TRACE level, false otherwise.
-
trace
-
trace
Description copied from interface:LoggerLog a message at the TRACE level according to the specified format and argument.This form avoids superfluous object creation when the logger is disabled for the TRACE level.
-
trace
Description copied from interface:LoggerLog a message at the TRACE level according to the specified format and arguments.This form avoids superfluous object creation when the logger is disabled for the TRACE level.
-
trace
Description copied from interface:LoggerLog a message at the TRACE level according to the specified format and arguments.This form avoids superfluous string concatenation when the logger is disabled for the TRACE level. However, this variant incurs the hidden (and relatively small) cost of creating an
Object[]before invoking the method, even if this logger is disabled for TRACE. The variants takingoneandtwoarguments exist solely in order to avoid this hidden cost. -
trace
-
isTraceEnabled
Description copied from interface:LoggerSimilar toLogger.isTraceEnabled()method except that the marker data is also taken into account.- Specified by:
isTraceEnabledin interfaceLogger- Parameters:
marker- The marker data to take into consideration- Returns:
- True if this Logger is enabled for the TRACE level, false otherwise.
-
trace
-
trace
Description copied from interface:LoggerThis method is similar toLogger.trace(String, Object)method except that the marker data is also taken into consideration. -
trace
Description copied from interface:LoggerThis method is similar toLogger.trace(String, Object, Object)method except that the marker data is also taken into consideration. -
trace
Description copied from interface:LoggerThis method is similar toLogger.trace(String, Object...)method except that the marker data is also taken into consideration. -
trace
Description copied from interface:LoggerThis method is similar toLogger.trace(String, Throwable)method except that the marker data is also taken into consideration. -
atTrace
Description copied from interface:LoggerEntry point for fluent-logging forLevel.TRACElevel. -
isDebugEnabled
Description copied from interface:LoggerIs the logger instance enabled for the DEBUG level?- Specified by:
isDebugEnabledin interfaceLogger- Returns:
- True if this Logger is enabled for the DEBUG level, false otherwise.
-
debug
-
debug
Description copied from interface:LoggerLog a message at the DEBUG level according to the specified format and argument.This form avoids superfluous object creation when the logger is disabled for the DEBUG level.
-
debug
Description copied from interface:LoggerLog a message at the DEBUG level according to the specified format and arguments.This form avoids superfluous object creation when the logger is disabled for the DEBUG level.
-
debug
Description copied from interface:LoggerLog a message at the DEBUG level according to the specified format and arguments.This form avoids superfluous string concatenation when the logger is disabled for the DEBUG level. However, this variant incurs the hidden (and relatively small) cost of creating an
Object[]before invoking the method, even if this logger is disabled for DEBUG. The variants takingoneandtwoarguments exist solely in order to avoid this hidden cost. -
debug
-
isDebugEnabled
Description copied from interface:LoggerSimilar toLogger.isDebugEnabled()method except that the marker data is also taken into account.- Specified by:
isDebugEnabledin interfaceLogger- Parameters:
marker- The marker data to take into consideration- Returns:
- True if this Logger is enabled for the DEBUG level, false otherwise.
-
debug
-
debug
Description copied from interface:LoggerThis method is similar toLogger.debug(String, Object)method except that the marker data is also taken into consideration. -
debug
Description copied from interface:LoggerThis method is similar toLogger.debug(String, Object, Object)method except that the marker data is also taken into consideration. -
debug
Description copied from interface:LoggerThis method is similar toLogger.debug(String, Object...)method except that the marker data is also taken into consideration. -
debug
Description copied from interface:LoggerThis method is similar toLogger.debug(String, Throwable)method except that the marker data is also taken into consideration. -
atDebug
Description copied from interface:LoggerEntry point for fluent-logging forLevel.DEBUGlevel. -
isInfoEnabled
Description copied from interface:LoggerIs the logger instance enabled for the INFO level?- Specified by:
isInfoEnabledin interfaceLogger- Returns:
- True if this Logger is enabled for the INFO level, false otherwise.
-
info
-
info
Description copied from interface:LoggerLog a message at the INFO level according to the specified format and argument.This form avoids superfluous object creation when the logger is disabled for the INFO level.
-
info
Description copied from interface:LoggerLog a message at the INFO level according to the specified format and arguments.This form avoids superfluous object creation when the logger is disabled for the INFO level.
-
info
Description copied from interface:LoggerLog a message at the INFO level according to the specified format and arguments.This form avoids superfluous string concatenation when the logger is disabled for the INFO level. However, this variant incurs the hidden (and relatively small) cost of creating an
Object[]before invoking the method, even if this logger is disabled for INFO. The variants takingoneandtwoarguments exist solely in order to avoid this hidden cost. -
info
-
isInfoEnabled
Description copied from interface:LoggerSimilar toLogger.isInfoEnabled()method except that the marker data is also taken into consideration.- Specified by:
isInfoEnabledin interfaceLogger- Parameters:
marker- The marker data to take into consideration- Returns:
- true if this Logger is enabled for the INFO level, false otherwise.
-
info
-
info
Description copied from interface:LoggerThis method is similar toLogger.info(String, Object)method except that the marker data is also taken into consideration. -
info
Description copied from interface:LoggerThis method is similar toLogger.info(String, Object, Object)method except that the marker data is also taken into consideration. -
info
Description copied from interface:LoggerThis method is similar toLogger.info(String, Object...)method except that the marker data is also taken into consideration. -
info
Description copied from interface:LoggerThis method is similar toLogger.info(String, Throwable)method except that the marker data is also taken into consideration. -
atInfo
Description copied from interface:LoggerEntry point for fluent-logging forLevel.INFOlevel. -
isWarnEnabled
Description copied from interface:LoggerIs the logger instance enabled for the WARN level?- Specified by:
isWarnEnabledin interfaceLogger- Returns:
- True if this Logger is enabled for the WARN level, false otherwise.
-
warn
-
warn
Description copied from interface:LoggerLog a message at the WARN level according to the specified format and argument.This form avoids superfluous object creation when the logger is disabled for the WARN level.
-
warn
Description copied from interface:LoggerLog a message at the WARN level according to the specified format and arguments.This form avoids superfluous object creation when the logger is disabled for the WARN level.
-
warn
Description copied from interface:LoggerLog a message at the WARN level according to the specified format and arguments.This form avoids superfluous string concatenation when the logger is disabled for the WARN level. However, this variant incurs the hidden (and relatively small) cost of creating an
Object[]before invoking the method, even if this logger is disabled for WARN. The variants takingoneandtwoarguments exist solely in order to avoid this hidden cost. -
warn
-
isWarnEnabled
Description copied from interface:LoggerSimilar toLogger.isWarnEnabled()method except that the marker data is also taken into consideration.- Specified by:
isWarnEnabledin interfaceLogger- Parameters:
marker- The marker data to take into consideration- Returns:
- True if this Logger is enabled for the WARN level, false otherwise.
-
warn
-
warn
Description copied from interface:LoggerThis method is similar toLogger.warn(String, Object)method except that the marker data is also taken into consideration. -
warn
Description copied from interface:LoggerThis method is similar toLogger.warn(String, Object, Object)method except that the marker data is also taken into consideration. -
warn
Description copied from interface:LoggerThis method is similar toLogger.warn(String, Object...)method except that the marker data is also taken into consideration. -
warn
Description copied from interface:LoggerThis method is similar toLogger.warn(String, Throwable)method except that the marker data is also taken into consideration. -
atWarn
Description copied from interface:LoggerEntry point for fluent-logging forLevel.WARNlevel. -
isErrorEnabled
Description copied from interface:LoggerIs the logger instance enabled for the ERROR level?- Specified by:
isErrorEnabledin interfaceLogger- Returns:
- True if this Logger is enabled for the ERROR level, false otherwise.
-
error
-
error
Description copied from interface:LoggerLog a message at the ERROR level according to the specified format and argument.This form avoids superfluous object creation when the logger is disabled for the ERROR level.
-
error
Description copied from interface:LoggerLog a message at the ERROR level according to the specified format and arguments.This form avoids superfluous object creation when the logger is disabled for the ERROR level.
-
error
Description copied from interface:LoggerLog a message at the ERROR level according to the specified format and arguments.This form avoids superfluous string concatenation when the logger is disabled for the ERROR level. However, this variant incurs the hidden (and relatively small) cost of creating an
Object[]before invoking the method, even if this logger is disabled for ERROR. The variants takingoneandtwoarguments exist solely in order to avoid this hidden cost. -
error
-
isErrorEnabled
Description copied from interface:LoggerSimilar toLogger.isErrorEnabled()method except that the marker data is also taken into consideration.- Specified by:
isErrorEnabledin interfaceLogger- Parameters:
marker- The marker data to take into consideration- Returns:
- True if this Logger is enabled for the ERROR level, false otherwise.
-
error
-
error
Description copied from interface:LoggerThis method is similar toLogger.error(String, Object)method except that the marker data is also taken into consideration. -
error
Description copied from interface:LoggerThis method is similar toLogger.error(String, Object, Object)method except that the marker data is also taken into consideration. -
error
Description copied from interface:LoggerThis method is similar toLogger.error(String, Object...)method except that the marker data is also taken into consideration. -
error
Description copied from interface:LoggerThis method is similar toLogger.error(String, Throwable)method except that the marker data is also taken into consideration. -
atError
Description copied from interface:LoggerEntry point for fluent-logging forLevel.ERRORlevel. -
equals
-
hashCode
-
delegate
-
setDelegate
Typically called after theLoggerFactoryinitialization phase is completed.- Parameters:
delegate-
-
isDelegateEventAware
-
log
-
isDelegateNull
-
isDelegateNOP
-