Package net.spy.memcached.compat.log
Interface Logger
- All Known Implementing Classes:
AbstractLogger
,DefaultLogger
,Log4JLogger
,SLF4JLogger
,SunLogger
public interface Logger
Abstract mechanism for dealing with logs from various objects.
Implementations are expected to have a constructor that takes a single String
representing the name of the logging item, or an empty constructor.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Log a message at debug level.void
Log a message at debug level.void
Log a formatted message at debug level.void
Log a message at error level.void
Log a message at error level.void
Log a formatted message at debug level.void
Log a message at fatal level.void
Log a message at fatal level.void
Log a formatted message at debug level.getName()
Get the name of this logger.void
Log a message at info level.void
Log a message at info level.void
Log a formatted message at info level.boolean
Checks whether DEBUG logging is enabled.boolean
Checks whether INFO logging is enabled.boolean
Checks whether TRACE logging is enabled.void
Log a message at the specified level.void
Log a message at the specified level.void
Log a message at trace level.void
Log a message at trace level.void
Log a formatted message at trace level.void
Log a message at warning level.void
Log a message at warning level.void
Log a formatted message at debug level.
-
Method Details
-
getName
String getName()Get the name of this logger. -
isDebugEnabled
boolean isDebugEnabled()Checks whether DEBUG logging is enabled. This may return true, even when the logger is configured to not put the resulting output anywhere. You can use this method to avoid potential expensive (debugging) code when there is no need for it since it will be dropped anyway:if (log.isDebugEnabled()) { ... expensive code here ... log.debug(result); }
- Returns:
- true if debug messages would be displayed.
-
isInfoEnabled
boolean isInfoEnabled()Checks whether INFO logging is enabled. This may return true, even when the logger is configured to not put the resulting output anywhere. You can use this method to avoid potential expensive (debugging) code when there is no need for it since it will be dropped anyway:if (log.isInfoEnabled()) { ... expensive code here ... log.info(result); }
- Returns:
- true if info messages would be displayed.
-
isTraceEnabled
boolean isTraceEnabled()Checks whether TRACE logging is enabled. This may return true, even when the logger is configured to not put the resulting output anywhere. You can use this method to avoid potential expensive (debugging) code when there is no need for it since it will be dropped anyway:if (log.isTraceEnabled()) { ... expensive code here ... log.trace(result); }
- Returns:
- true if trace messages would be displayed.
-
log
Log a message at the specified level.- Parameters:
level
- the level at which to logmessage
- the message to logexception
- an exception that caused the message
-
log
Log a message at the specified level.- Parameters:
level
- the level at which to logmessage
- the message to log
-
trace
Log a message at trace level.- Parameters:
message
- the message to logexception
- the exception that caused the message to be generated
-
trace
Log a message at trace level.- Parameters:
message
- the message to log
-
trace
Log a formatted message at trace level.- Parameters:
message
- the message to logargs
- the arguments for that message
-
debug
Log a message at debug level.- Parameters:
message
- the message to logexception
- the exception that caused the message to be generated
-
debug
Log a message at debug level.- Parameters:
message
- the message to log
-
debug
Log a formatted message at debug level.- Parameters:
message
- the message to logargs
- the arguments for that message
-
info
Log a message at info level.- Parameters:
message
- the message to logexception
- the exception that caused the message to be generated
-
info
Log a message at info level.- Parameters:
message
- the message to log
-
info
Log a formatted message at info level.- Parameters:
message
- the message to logargs
- the arguments for that message
-
warn
Log a message at warning level.- Parameters:
message
- the message to logexception
- the exception that caused the message to be generated
-
warn
Log a message at warning level.- Parameters:
message
- the message to log
-
warn
Log a formatted message at debug level.- Parameters:
message
- the message to logargs
- the arguments for that message
-
error
Log a message at error level.- Parameters:
message
- the message to logexception
- the exception that caused the message to be generated
-
error
Log a message at error level.- Parameters:
message
- the message to log
-
error
Log a formatted message at debug level.- Parameters:
message
- the message to logargs
- the arguments for that message
-
fatal
Log a message at fatal level.- Parameters:
message
- the message to logexception
- the exception that caused the message to be generated
-
fatal
Log a message at fatal level.- Parameters:
message
- the message to log
-
fatal
Log a formatted message at debug level.- Parameters:
message
- the message to logargs
- the arguments for that message
-