Class SubstituteLogger
- java.lang.Object
-
- org.slf4j.helpers.SubstituteLogger
-
- All Implemented Interfaces:
Logger
public class SubstituteLogger extends java.lang.Object implements Logger
A logger implementation which logs via a delegate logger. By default, the delegate is aNOPLogger. However, a different delegate can be set at any time. See also the relevant error code documentation.
-
-
Field Summary
-
Fields inherited from interface org.slf4j.Logger
ROOT_LOGGER_NAME
-
-
Constructor Summary
Constructors Constructor Description SubstituteLogger(java.lang.String name, java.util.Queue<SubstituteLoggingEvent> eventQueue, boolean createdPostInitialization)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddebug(java.lang.String msg)Log a message at the DEBUG level.voiddebug(java.lang.String format, java.lang.Object arg)Log a message at the DEBUG level according to the specified format and argument.voiddebug(java.lang.String format, java.lang.Object... arguments)Log a message at the DEBUG level according to the specified format and arguments.voiddebug(java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)Log a message at the DEBUG level according to the specified format and arguments.voiddebug(java.lang.String msg, java.lang.Throwable t)Log an exception (throwable) at the DEBUG level with an accompanying message.voiddebug(Marker marker, java.lang.String msg)Log a message with the specific Marker at the DEBUG level.voiddebug(Marker marker, java.lang.String format, java.lang.Object arg)This method is similar toLogger.debug(String, Object)method except that the marker data is also taken into consideration.voiddebug(Marker marker, java.lang.String format, java.lang.Object... arguments)This method is similar toLogger.debug(String, Object...)method except that the marker data is also taken into consideration.voiddebug(Marker marker, java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)This method is similar toLogger.debug(String, Object, Object)method except that the marker data is also taken into consideration.voiddebug(Marker marker, java.lang.String msg, java.lang.Throwable t)This method is similar toLogger.debug(String, Throwable)method except that the marker data is also taken into consideration.booleanequals(java.lang.Object o)voiderror(java.lang.String msg)Log a message at the ERROR level.voiderror(java.lang.String format, java.lang.Object arg)Log a message at the ERROR level according to the specified format and argument.voiderror(java.lang.String format, java.lang.Object... arguments)Log a message at the ERROR level according to the specified format and arguments.voiderror(java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)Log a message at the ERROR level according to the specified format and arguments.voiderror(java.lang.String msg, java.lang.Throwable t)Log an exception (throwable) at the ERROR level with an accompanying message.voiderror(Marker marker, java.lang.String msg)Log a message with the specific Marker at the ERROR level.voiderror(Marker marker, java.lang.String format, java.lang.Object arg)This method is similar toLogger.error(String, Object)method except that the marker data is also taken into consideration.voiderror(Marker marker, java.lang.String format, java.lang.Object... arguments)This method is similar toLogger.error(String, Object...)method except that the marker data is also taken into consideration.voiderror(Marker marker, java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)This method is similar toLogger.error(String, Object, Object)method except that the marker data is also taken into consideration.voiderror(Marker marker, java.lang.String msg, java.lang.Throwable t)This method is similar toLogger.error(String, Throwable)method except that the marker data is also taken into consideration.java.lang.StringgetName()Return the name of thisLoggerinstance.inthashCode()voidinfo(java.lang.String msg)Log a message at the INFO level.voidinfo(java.lang.String format, java.lang.Object arg)Log a message at the INFO level according to the specified format and argument.voidinfo(java.lang.String format, java.lang.Object... arguments)Log a message at the INFO level according to the specified format and arguments.voidinfo(java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)Log a message at the INFO level according to the specified format and arguments.voidinfo(java.lang.String msg, java.lang.Throwable t)Log an exception (throwable) at the INFO level with an accompanying message.voidinfo(Marker marker, java.lang.String msg)Log a message with the specific Marker at the INFO level.voidinfo(Marker marker, java.lang.String format, java.lang.Object arg)This method is similar toLogger.info(String, Object)method except that the marker data is also taken into consideration.voidinfo(Marker marker, java.lang.String format, java.lang.Object... arguments)This method is similar toLogger.info(String, Object...)method except that the marker data is also taken into consideration.voidinfo(Marker marker, java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)This method is similar toLogger.info(String, Object, Object)method except that the marker data is also taken into consideration.voidinfo(Marker marker, java.lang.String msg, java.lang.Throwable t)This method is similar toLogger.info(String, Throwable)method except that the marker data is also taken into consideration.booleanisDebugEnabled()Is 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.booleanisDelegateEventAware()booleanisDelegateNOP()booleanisDelegateNull()booleanisErrorEnabled()Is 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.booleanisInfoEnabled()Is 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.booleanisTraceEnabled()Is 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.booleanisWarnEnabled()Is 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)voidsetDelegate(Logger delegate)Typically called after theLoggerFactoryinitialization phase is completed.voidtrace(java.lang.String msg)Log a message at the TRACE level.voidtrace(java.lang.String format, java.lang.Object arg)Log a message at the TRACE level according to the specified format and argument.voidtrace(java.lang.String format, java.lang.Object... arguments)Log a message at the TRACE level according to the specified format and arguments.voidtrace(java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)Log a message at the TRACE level according to the specified format and arguments.voidtrace(java.lang.String msg, java.lang.Throwable t)Log an exception (throwable) at the TRACE level with an accompanying message.voidtrace(Marker marker, java.lang.String msg)Log a message with the specific Marker at the TRACE level.voidtrace(Marker marker, java.lang.String format, java.lang.Object arg)This method is similar toLogger.trace(String, Object)method except that the marker data is also taken into consideration.voidtrace(Marker marker, java.lang.String format, java.lang.Object... arguments)This method is similar toLogger.trace(String, Object...)method except that the marker data is also taken into consideration.voidtrace(Marker marker, java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)This method is similar toLogger.trace(String, Object, Object)method except that the marker data is also taken into consideration.voidtrace(Marker marker, java.lang.String msg, java.lang.Throwable t)This method is similar toLogger.trace(String, Throwable)method except that the marker data is also taken into consideration.voidwarn(java.lang.String msg)Log a message at the WARN level.voidwarn(java.lang.String format, java.lang.Object arg)Log a message at the WARN level according to the specified format and argument.voidwarn(java.lang.String format, java.lang.Object... arguments)Log a message at the WARN level according to the specified format and arguments.voidwarn(java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)Log a message at the WARN level according to the specified format and arguments.voidwarn(java.lang.String msg, java.lang.Throwable t)Log an exception (throwable) at the WARN level with an accompanying message.voidwarn(Marker marker, java.lang.String msg)Log a message with the specific Marker at the WARN level.voidwarn(Marker marker, java.lang.String format, java.lang.Object arg)This method is similar toLogger.warn(String, Object)method except that the marker data is also taken into consideration.voidwarn(Marker marker, java.lang.String format, java.lang.Object... arguments)This method is similar toLogger.warn(String, Object...)method except that the marker data is also taken into consideration.voidwarn(Marker marker, java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)This method is similar toLogger.warn(String, Object, Object)method except that the marker data is also taken into consideration.voidwarn(Marker marker, java.lang.String msg, java.lang.Throwable t)This method is similar toLogger.warn(String, Throwable)method except that the marker data is also taken into consideration.
-
-
-
Constructor Detail
-
SubstituteLogger
public SubstituteLogger(java.lang.String name, java.util.Queue<SubstituteLoggingEvent> eventQueue, boolean createdPostInitialization)
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from interface:LoggerReturn the name of thisLoggerinstance.
-
isTraceEnabled
public boolean 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
public void trace(java.lang.String msg)
Description copied from interface:LoggerLog a message at the TRACE level.
-
trace
public void trace(java.lang.String format, java.lang.Object arg)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
public void trace(java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)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
public void trace(java.lang.String format, java.lang.Object... arguments)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
public void trace(java.lang.String msg, java.lang.Throwable t)Description copied from interface:LoggerLog an exception (throwable) at the TRACE level with an accompanying message.
-
isTraceEnabled
public boolean isTraceEnabled(Marker marker)
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
public void trace(Marker marker, java.lang.String msg)
Description copied from interface:LoggerLog a message with the specific Marker at the TRACE level.
-
trace
public void trace(Marker marker, java.lang.String format, java.lang.Object arg)
Description copied from interface:LoggerThis method is similar toLogger.trace(String, Object)method except that the marker data is also taken into consideration.
-
trace
public void trace(Marker marker, java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)
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
public void trace(Marker marker, java.lang.String format, java.lang.Object... arguments)
Description copied from interface:LoggerThis method is similar toLogger.trace(String, Object...)method except that the marker data is also taken into consideration.
-
trace
public void trace(Marker marker, java.lang.String msg, java.lang.Throwable t)
Description copied from interface:LoggerThis method is similar toLogger.trace(String, Throwable)method except that the marker data is also taken into consideration.
-
isDebugEnabled
public boolean 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
public void debug(java.lang.String msg)
Description copied from interface:LoggerLog a message at the DEBUG level.
-
debug
public void debug(java.lang.String format, java.lang.Object arg)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
public void debug(java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)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
public void debug(java.lang.String format, java.lang.Object... arguments)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
public void debug(java.lang.String msg, java.lang.Throwable t)Description copied from interface:LoggerLog an exception (throwable) at the DEBUG level with an accompanying message.
-
isDebugEnabled
public boolean isDebugEnabled(Marker marker)
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
public void debug(Marker marker, java.lang.String msg)
Description copied from interface:LoggerLog a message with the specific Marker at the DEBUG level.
-
debug
public void debug(Marker marker, java.lang.String format, java.lang.Object arg)
Description copied from interface:LoggerThis method is similar toLogger.debug(String, Object)method except that the marker data is also taken into consideration.
-
debug
public void debug(Marker marker, java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)
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
public void debug(Marker marker, java.lang.String format, java.lang.Object... arguments)
Description copied from interface:LoggerThis method is similar toLogger.debug(String, Object...)method except that the marker data is also taken into consideration.
-
debug
public void debug(Marker marker, java.lang.String msg, java.lang.Throwable t)
Description copied from interface:LoggerThis method is similar toLogger.debug(String, Throwable)method except that the marker data is also taken into consideration.
-
isInfoEnabled
public boolean 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
public void info(java.lang.String msg)
Description copied from interface:LoggerLog a message at the INFO level.
-
info
public void info(java.lang.String format, java.lang.Object arg)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
public void info(java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)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
public void info(java.lang.String format, java.lang.Object... arguments)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
public void info(java.lang.String msg, java.lang.Throwable t)Description copied from interface:LoggerLog an exception (throwable) at the INFO level with an accompanying message.
-
isInfoEnabled
public boolean isInfoEnabled(Marker marker)
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 warn enabled, false otherwise
-
info
public void info(Marker marker, java.lang.String msg)
Description copied from interface:LoggerLog a message with the specific Marker at the INFO level.
-
info
public void info(Marker marker, java.lang.String format, java.lang.Object arg)
Description copied from interface:LoggerThis method is similar toLogger.info(String, Object)method except that the marker data is also taken into consideration.
-
info
public void info(Marker marker, java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)
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
public void info(Marker marker, java.lang.String format, java.lang.Object... arguments)
Description copied from interface:LoggerThis method is similar toLogger.info(String, Object...)method except that the marker data is also taken into consideration.
-
info
public void info(Marker marker, java.lang.String msg, java.lang.Throwable t)
Description copied from interface:LoggerThis method is similar toLogger.info(String, Throwable)method except that the marker data is also taken into consideration.
-
isWarnEnabled
public boolean 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
public void warn(java.lang.String msg)
Description copied from interface:LoggerLog a message at the WARN level.
-
warn
public void warn(java.lang.String format, java.lang.Object arg)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
public void warn(java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)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
public void warn(java.lang.String format, java.lang.Object... arguments)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
public void warn(java.lang.String msg, java.lang.Throwable t)Description copied from interface:LoggerLog an exception (throwable) at the WARN level with an accompanying message.
-
isWarnEnabled
public boolean isWarnEnabled(Marker marker)
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
public void warn(Marker marker, java.lang.String msg)
Description copied from interface:LoggerLog a message with the specific Marker at the WARN level.
-
warn
public void warn(Marker marker, java.lang.String format, java.lang.Object arg)
Description copied from interface:LoggerThis method is similar toLogger.warn(String, Object)method except that the marker data is also taken into consideration.
-
warn
public void warn(Marker marker, java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)
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
public void warn(Marker marker, java.lang.String format, java.lang.Object... arguments)
Description copied from interface:LoggerThis method is similar toLogger.warn(String, Object...)method except that the marker data is also taken into consideration.
-
warn
public void warn(Marker marker, java.lang.String msg, java.lang.Throwable t)
Description copied from interface:LoggerThis method is similar toLogger.warn(String, Throwable)method except that the marker data is also taken into consideration.
-
isErrorEnabled
public boolean 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
public void error(java.lang.String msg)
Description copied from interface:LoggerLog a message at the ERROR level.
-
error
public void error(java.lang.String format, java.lang.Object arg)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
public void error(java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)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
public void error(java.lang.String format, java.lang.Object... arguments)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
public void error(java.lang.String msg, java.lang.Throwable t)Description copied from interface:LoggerLog an exception (throwable) at the ERROR level with an accompanying message.
-
isErrorEnabled
public boolean isErrorEnabled(Marker marker)
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
public void error(Marker marker, java.lang.String msg)
Description copied from interface:LoggerLog a message with the specific Marker at the ERROR level.
-
error
public void error(Marker marker, java.lang.String format, java.lang.Object arg)
Description copied from interface:LoggerThis method is similar toLogger.error(String, Object)method except that the marker data is also taken into consideration.
-
error
public void error(Marker marker, java.lang.String format, java.lang.Object arg1, java.lang.Object arg2)
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
public void error(Marker marker, java.lang.String format, java.lang.Object... arguments)
Description copied from interface:LoggerThis method is similar toLogger.error(String, Object...)method except that the marker data is also taken into consideration.
-
error
public void error(Marker marker, java.lang.String msg, java.lang.Throwable t)
Description copied from interface:LoggerThis method is similar toLogger.error(String, Throwable)method except that the marker data is also taken into consideration.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
setDelegate
public void setDelegate(Logger delegate)
Typically called after theLoggerFactoryinitialization phase is completed.- Parameters:
delegate-
-
isDelegateEventAware
public boolean isDelegateEventAware()
-
log
public void log(LoggingEvent event)
-
isDelegateNull
public boolean isDelegateNull()
-
isDelegateNOP
public boolean isDelegateNOP()
-
-