Package org.slf4j.helpers
Class NOPLogger
java.lang.Object
org.slf4j.helpers.MarkerIgnoringBase
org.slf4j.helpers.NOPLogger
- All Implemented Interfaces:
Serializable,Logger
A direct NOP (no operation) implementation of
Logger.- Author:
- Ceki Gülcü
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringstatic final NOPLoggerThe unique instance of NOPLogger.Fields inherited from interface org.slf4j.Logger
ROOT_LOGGER_NAME -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedThere is no point in creating multiple instances of NOPLogger, except by derived classes, hence the protected access for the constructor. -
Method Summary
Modifier and TypeMethodDescriptionfinal voidA NOP implementation.final voidA NOP implementation.final voidA NOP implementation.final voidA NOP implementation.final voidA NOP implementation.final voidA NOP implementation.final voidA NOP implementation.final voidA NOP implementation.final voidA NOP implementation.final voidA NOP implementation.getName()Always returns the string value "NOP".final voidA NOP implementation.final voidA NOP implementation.final voidA NOP implementation.final voidA NOP implementation.final voidA NOP implementation.final booleanAlways returns false.final booleanA NOP implementation.final booleanAlways returns false.final booleanAlways returns false.final booleanAlways returns false.protected ObjectReplace this instance with a homonymous (same name) logger returned by LoggerFactory.final voidA NOP implementation.final voidA NOP implementation.final voidA NOP implementation.final voidA NOP implementation.final voidA NOP implementation.final voidA NOP implementation.final voidA NOP implementation.final voidA NOP implementation.final voidA NOP implementation.final voidA NOP implementation.Methods inherited from class org.slf4j.helpers.MarkerIgnoringBase
debug, debug, debug, debug, debug, error, error, error, error, error, info, info, info, info, info, isDebugEnabled, isErrorEnabled, isInfoEnabled, isTraceEnabled, isWarnEnabled, toString, trace, trace, trace, trace, trace, warn, warn, warn, warn, warn
-
Field Details
-
NOP_LOGGER
The unique instance of NOPLogger. -
name
-
-
Constructor Details
-
NOPLogger
protected NOPLogger()There is no point in creating multiple instances of NOPLogger, except by derived classes, hence the protected access for the constructor.
-
-
Method Details
-
getName
Always returns the string value "NOP". -
isTraceEnabled
public final boolean isTraceEnabled()Always returns false.- Returns:
- always false
-
trace
A NOP implementation.- Parameters:
msg- the message string to be logged
-
trace
A NOP implementation.- Parameters:
format- the format stringarg- the argument
-
trace
A NOP implementation.- Parameters:
format- the format stringarg1- the first argumentarg2- the second argument
-
trace
A NOP implementation.- Parameters:
format- the format stringargArray- a list of 3 or more arguments
-
trace
A NOP implementation.- Parameters:
msg- the message accompanying the exceptiont- the exception (throwable) to log
-
isDebugEnabled
public final boolean isDebugEnabled()Always returns false.- Returns:
- always false
-
debug
A NOP implementation.- Parameters:
msg- the message string to be logged
-
debug
A NOP implementation.- Parameters:
format- the format stringarg- the argument
-
debug
A NOP implementation.- Parameters:
format- the format stringarg1- the first argumentarg2- the second argument
-
debug
A NOP implementation.- Parameters:
format- the format stringargArray- a list of 3 or more arguments
-
debug
A NOP implementation.- Parameters:
msg- the message accompanying the exceptiont- the exception (throwable) to log
-
isInfoEnabled
public final boolean isInfoEnabled()Always returns false.- Returns:
- always false
-
info
A NOP implementation.- Parameters:
msg- the message string to be logged
-
info
A NOP implementation.- Parameters:
format- the format stringarg1- the argument
-
info
A NOP implementation.- Parameters:
format- the format stringarg1- the first argumentarg2- the second argument
-
info
A NOP implementation.- Parameters:
format- the format stringargArray- a list of 3 or more arguments
-
info
A NOP implementation.- Parameters:
msg- the message accompanying the exceptiont- the exception (throwable) to log
-
isWarnEnabled
public final boolean isWarnEnabled()Always returns false.- Returns:
- always false
-
warn
A NOP implementation.- Parameters:
msg- the message string to be logged
-
warn
A NOP implementation.- Parameters:
format- the format stringarg1- the argument
-
warn
A NOP implementation.- Parameters:
format- the format stringarg1- the first argumentarg2- the second argument
-
warn
A NOP implementation.- Parameters:
format- the format stringargArray- a list of 3 or more arguments
-
warn
A NOP implementation.- Parameters:
msg- the message accompanying the exceptiont- the exception (throwable) to log
-
isErrorEnabled
public final boolean isErrorEnabled()A NOP implementation.- Returns:
- True if this Logger is enabled for the ERROR level, false otherwise.
-
error
A NOP implementation.- Parameters:
msg- the message string to be logged
-
error
A NOP implementation.- Parameters:
format- the format stringarg1- the argument
-
error
A NOP implementation.- Parameters:
format- the format stringarg1- the first argumentarg2- the second argument
-
error
A NOP implementation.- Parameters:
format- the format stringargArray- a list of 3 or more arguments
-
error
A NOP implementation.- Parameters:
msg- the message accompanying the exceptiont- the exception (throwable) to log
-
readResolve
Replace this instance with a homonymous (same name) logger returned by LoggerFactory. Note that this method is only called during deserialization.This approach will work well if the desired ILoggerFactory is the one references by LoggerFactory. However, if the user manages its logger hierarchy through a different (non-static) mechanism, e.g. dependency injection, then this approach would be mostly counterproductive.
- Returns:
- logger with same name as returned by LoggerFactory
- Throws:
ObjectStreamException
-