Package net.spy.memcached.compat.log
Class SunLogger
java.lang.Object
net.spy.memcached.compat.log.AbstractLogger
net.spy.memcached.compat.log.SunLogger
- All Implemented Interfaces:
Logger
Logging implementation using the sun logger.
The SunLogger implements logging using the java.util.logging facilities. Since the logging levels provided by this implementations do not map directly to those provided by SLF4J or Log4J, different mappings are applied.
Aside from the logging levels that are named the same, all log messages that get logged at the TRACE level get translated to the FINEST level. Also, both ERROR and FATAL levels get translated to SEVERE.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanTrue if debug is enabled for this logger.booleanTrue if debug is enabled for this logger.booleanChecks whether TRACE logging is enabled.voidWrapper around sun logger.
-
Constructor Details
-
SunLogger
Get an instance of SunLogger.
-
-
Method Details
-
isTraceEnabled
public boolean isTraceEnabled()Description copied from interface:LoggerChecks 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.
-
isDebugEnabled
public boolean isDebugEnabled()Description copied from class:AbstractLoggerTrue if debug is enabled for this logger. Default implementation always returns false- Specified by:
isDebugEnabledin interfaceLogger- Specified by:
isDebugEnabledin classAbstractLogger- Returns:
- true if debug messages would be displayed
-
isInfoEnabled
public boolean isInfoEnabled()Description copied from class:AbstractLoggerTrue if debug is enabled for this logger. Default implementation always returns false- Specified by:
isInfoEnabledin interfaceLogger- Specified by:
isInfoEnabledin classAbstractLogger- Returns:
- true if info messages would be displayed
-
log
Wrapper around sun logger.- Specified by:
login interfaceLogger- Specified by:
login classAbstractLogger- Parameters:
level- net.spy.compat.log.AbstractLogger level.message- object messagee- optional throwable
-