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 SummaryFieldsFields inherited from interface org.slf4j.LoggerROOT_LOGGER_NAME
- 
Constructor SummaryConstructorsConstructorDescriptionSubstituteLogger(String name, Queue<SubstituteLoggingEvent> eventQueue, boolean createdPostInitialization) 
- 
Method SummaryModifier 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- 
SubstituteLoggerpublic SubstituteLogger(String name, Queue<SubstituteLoggingEvent> eventQueue, boolean createdPostInitialization) 
 
- 
- 
Method Details- 
getName
- 
makeLoggingEventBuilderDescription 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 interface- Logger
- Parameters:
- level- desired level for the event builder
- Returns:
- a new LoggingEventBuilderinstance as appropriate for this logger
 
- 
atLevelDescription 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 interface- Logger
- Parameters:
- level- desired level for the event builder
- Returns:
- a new LoggingEventBuilderinstance as appropriate for this logger
 
- 
isEnabledForLevelDescription copied from interface:LoggerReturns whether this Logger is enabled for a givenLevel.- Specified by:
- isEnabledForLevelin interface- Logger
- Parameters:
- level-
- Returns:
- true if enabled, false otherwise.
 
- 
isTraceEnabledDescription copied from interface:LoggerIs the logger instance enabled for the TRACE level?- Specified by:
- isTraceEnabledin interface- Logger
- Returns:
- True if this Logger is enabled for the TRACE level, false otherwise.
 
- 
trace
- 
traceDescription 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. 
- 
traceDescription 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. 
- 
traceDescription 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
- 
isTraceEnabledDescription copied from interface:LoggerSimilar toLogger.isTraceEnabled()method except that the marker data is also taken into account.- Specified by:
- isTraceEnabledin interface- Logger
- Parameters:
- marker- The marker data to take into consideration
- Returns:
- True if this Logger is enabled for the TRACE level, false otherwise.
 
- 
trace
- 
traceDescription copied from interface:LoggerThis method is similar toLogger.trace(String, Object)method except that the marker data is also taken into consideration.
- 
traceDescription copied from interface:LoggerThis method is similar toLogger.trace(String, Object, Object)method except that the marker data is also taken into consideration.
- 
traceDescription copied from interface:LoggerThis method is similar toLogger.trace(String, Object...)method except that the marker data is also taken into consideration.
- 
traceDescription copied from interface:LoggerThis method is similar toLogger.trace(String, Throwable)method except that the marker data is also taken into consideration.
- 
atTraceDescription copied from interface:LoggerEntry point for fluent-logging forLevel.TRACElevel.
- 
isDebugEnabledDescription copied from interface:LoggerIs the logger instance enabled for the DEBUG level?- Specified by:
- isDebugEnabledin interface- Logger
- Returns:
- True if this Logger is enabled for the DEBUG level, false otherwise.
 
- 
debug
- 
debugDescription 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. 
- 
debugDescription 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. 
- 
debugDescription 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
- 
isDebugEnabledDescription copied from interface:LoggerSimilar toLogger.isDebugEnabled()method except that the marker data is also taken into account.- Specified by:
- isDebugEnabledin interface- Logger
- Parameters:
- marker- The marker data to take into consideration
- Returns:
- True if this Logger is enabled for the DEBUG level, false otherwise.
 
- 
debug
- 
debugDescription copied from interface:LoggerThis method is similar toLogger.debug(String, Object)method except that the marker data is also taken into consideration.
- 
debugDescription copied from interface:LoggerThis method is similar toLogger.debug(String, Object, Object)method except that the marker data is also taken into consideration.
- 
debugDescription copied from interface:LoggerThis method is similar toLogger.debug(String, Object...)method except that the marker data is also taken into consideration.
- 
debugDescription copied from interface:LoggerThis method is similar toLogger.debug(String, Throwable)method except that the marker data is also taken into consideration.
- 
atDebugDescription copied from interface:LoggerEntry point for fluent-logging forLevel.DEBUGlevel.
- 
isInfoEnabledDescription copied from interface:LoggerIs the logger instance enabled for the INFO level?- Specified by:
- isInfoEnabledin interface- Logger
- Returns:
- True if this Logger is enabled for the INFO level, false otherwise.
 
- 
info
- 
infoDescription 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. 
- 
infoDescription 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. 
- 
infoDescription 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
- 
isInfoEnabledDescription copied from interface:LoggerSimilar toLogger.isInfoEnabled()method except that the marker data is also taken into consideration.- Specified by:
- isInfoEnabledin interface- Logger
- Parameters:
- marker- The marker data to take into consideration
- Returns:
- true if this Logger is enabled for the INFO level, false otherwise.
 
- 
info
- 
infoDescription copied from interface:LoggerThis method is similar toLogger.info(String, Object)method except that the marker data is also taken into consideration.
- 
infoDescription copied from interface:LoggerThis method is similar toLogger.info(String, Object, Object)method except that the marker data is also taken into consideration.
- 
infoDescription copied from interface:LoggerThis method is similar toLogger.info(String, Object...)method except that the marker data is also taken into consideration.
- 
infoDescription copied from interface:LoggerThis method is similar toLogger.info(String, Throwable)method except that the marker data is also taken into consideration.
- 
atInfoDescription copied from interface:LoggerEntry point for fluent-logging forLevel.INFOlevel.
- 
isWarnEnabledDescription copied from interface:LoggerIs the logger instance enabled for the WARN level?- Specified by:
- isWarnEnabledin interface- Logger
- Returns:
- True if this Logger is enabled for the WARN level, false otherwise.
 
- 
warn
- 
warnDescription 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. 
- 
warnDescription 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. 
- 
warnDescription 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
- 
isWarnEnabledDescription copied from interface:LoggerSimilar toLogger.isWarnEnabled()method except that the marker data is also taken into consideration.- Specified by:
- isWarnEnabledin interface- Logger
- Parameters:
- marker- The marker data to take into consideration
- Returns:
- True if this Logger is enabled for the WARN level, false otherwise.
 
- 
warn
- 
warnDescription copied from interface:LoggerThis method is similar toLogger.warn(String, Object)method except that the marker data is also taken into consideration.
- 
warnDescription copied from interface:LoggerThis method is similar toLogger.warn(String, Object, Object)method except that the marker data is also taken into consideration.
- 
warnDescription copied from interface:LoggerThis method is similar toLogger.warn(String, Object...)method except that the marker data is also taken into consideration.
- 
warnDescription copied from interface:LoggerThis method is similar toLogger.warn(String, Throwable)method except that the marker data is also taken into consideration.
- 
atWarnDescription copied from interface:LoggerEntry point for fluent-logging forLevel.WARNlevel.
- 
isErrorEnabledDescription copied from interface:LoggerIs the logger instance enabled for the ERROR level?- Specified by:
- isErrorEnabledin interface- Logger
- Returns:
- True if this Logger is enabled for the ERROR level, false otherwise.
 
- 
error
- 
errorDescription 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. 
- 
errorDescription 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. 
- 
errorDescription 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
- 
isErrorEnabledDescription copied from interface:LoggerSimilar toLogger.isErrorEnabled()method except that the marker data is also taken into consideration.- Specified by:
- isErrorEnabledin interface- Logger
- Parameters:
- marker- The marker data to take into consideration
- Returns:
- True if this Logger is enabled for the ERROR level, false otherwise.
 
- 
error
- 
errorDescription copied from interface:LoggerThis method is similar toLogger.error(String, Object)method except that the marker data is also taken into consideration.
- 
errorDescription copied from interface:LoggerThis method is similar toLogger.error(String, Object, Object)method except that the marker data is also taken into consideration.
- 
errorDescription copied from interface:LoggerThis method is similar toLogger.error(String, Object...)method except that the marker data is also taken into consideration.
- 
errorDescription copied from interface:LoggerThis method is similar toLogger.error(String, Throwable)method except that the marker data is also taken into consideration.
- 
atErrorDescription copied from interface:LoggerEntry point for fluent-logging forLevel.ERRORlevel.
- 
equals
- 
hashCode
- 
delegate
- 
setDelegateTypically called after theLoggerFactoryinitialization phase is completed.- Parameters:
- delegate-
 
- 
isDelegateEventAware
- 
log
- 
isDelegateNull
- 
isDelegateNOP
 
-