Interface Logger
-
- All Known Subinterfaces:
JobLogger,com.redwood.scheduler.infrastructure.logging.LoggerSetLevel,TriggerLogger
public interface LoggerRedwood logging.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voiddebug(String message)Log a message object with theDEBUGlevel to the server logs.voiddebug(String message, Throwable t)Log a message object, along with the associated exception, with theDEBUGlevel to the server logs.default voiddebug(Supplier<String> logMessage)Log a message object with theDEBUGlevel to the server logs.default voiddebug(Supplier<String> logMessage, Throwable t)Similar todebug(Supplier)but with an optional exception that should be loggedvoiderror(String message)Log a message object with theERRORlevel to the server logs.voiderror(String message, Throwable t)Log a message object, along with the associated exception, with theERRORlevel to the server logs.voidfatal(String message)Log a message object with theFATALlevel to the server logs.voidfatal(String message, Throwable t)Log a message object, along with the associated exception, with theFATALlevel to the server logs.voidinfo(String message)Log a message object with theINFOlevel to the server logs.voidinfo(String message, Throwable t)Log a message object, along with the associated exception, with theINFOlevel to the server logs.default voidinfo(Supplier<String> logMessage)Log a message object with theINFOlevel.default voidinfo(Supplier<String> logMessage, Throwable t)Similar toinfo(Supplier)but with an optional exception that should be loggedbooleanisDebugEnabled()Check whether this logger is enabled for theDEBUGLevel.booleanisEnabledFor(Level level)Check whether this logger is enabled for a givenLevelpassed as parameter.booleanisInfoEnabled()Check whether this logger is enabled for theINFOLevel.voidlog(Level level, String message)Log a message at a particular level.voidlog(Level level, String message, Throwable t)Log a message at a particular level.voidwarn(String message)Log a message object with theWARNlevel to the server logs.voidwarn(String message, Throwable t)Log a message object, along with the associated exception, with theWARNlevel to the server logs.
-
-
-
Method Detail
-
debug
void debug(String message)
Log a message object with theDEBUGlevel to the server logs. This method first checks if this Logger isDEBUGenabled by comparing the level of this Logger with theDEBUGlevel. If this Logger isDEBUGenabled, then it logs the message.- Parameters:
message- the message to log.
-
debug
void debug(String message, Throwable t)
Log a message object, along with the associated exception, with theDEBUGlevel to the server logs.- Parameters:
message- the message to log.t- an optional exception to log with the message.- See Also:
debug(String)
-
info
void info(String message)
Log a message object with theINFOlevel to the server logs. This method first checks if this Logger isINFOenabled by comparing the level of this Logger with theINFOlevel. If this Logger isINFOenabled, then it logs the message.- Parameters:
message- the message to log.
-
info
void info(String message, Throwable t)
Log a message object, along with the associated exception, with theINFOlevel to the server logs.- Parameters:
message- the message to log.t- an optional exception to log with the message.- See Also:
info(String)
-
warn
void warn(String message)
Log a message object with theWARNlevel to the server logs. This method first checks if this Logger isWARNenabled by comparing the level of this Logger with theWARNlevel. If this Logger isWARNenabled, then it logs the message.- Parameters:
message- the message to log.
-
warn
void warn(String message, Throwable t)
Log a message object, along with the associated exception, with theWARNlevel to the server logs.- Parameters:
message- the message to log.t- an optional exception to log with the message.- See Also:
warn(String)
-
error
void error(String message)
Log a message object with theERRORlevel to the server logs. This method first checks if this Logger isERRORenabled by comparing the level of this Logger with theERRORlevel. If this Logger isERRORenabled, then it logs the message.- Parameters:
message- the message to log.
-
error
void error(String message, Throwable t)
Log a message object, along with the associated exception, with theERRORlevel to the server logs.- Parameters:
message- the message to log.t- an optional exception to log with the message.- See Also:
error(String)
-
fatal
void fatal(String message)
Log a message object with theFATALlevel to the server logs. This method first checks if this Logger isFATALenabled by comparing the level of this Logger with theFATALlevel. If this Logger isFATALenabled, then it logs the message.- Parameters:
message- the message to log.
-
fatal
void fatal(String message, Throwable t)
Log a message object, along with the associated exception, with theFATALlevel to the server logs.- Parameters:
message- the message to log.t- an optional exception to log with the message.- See Also:
fatal(String)
-
isDebugEnabled
boolean isDebugEnabled()
Check whether this logger is enabled for theDEBUGLevel.This function is intended to lessen the computational cost of disabled log debug statements.
For some
logLogger object, when you write,log.debug("This is entry number: " + i);You incur the cost constructing the message, concatenation in this case, regardless of whether the message is logged or not.
If you are worried about speed, then you should use
debug(Supplier)This way you will not incur the cost of parameter construction if debugging is disabled for
log.- Returns:
- boolean -
trueif this Logger is debug enabled,falseotherwise.
-
isInfoEnabled
boolean isInfoEnabled()
Check whether this logger is enabled for theINFOLevel.This function is intended to lessen the computational cost of disabled log debug statements.
For some
logLoggeLogger object, when you write,log.debug("This is entry number: " + i);You incur the cost constructing the message, concatenation in this case, regardless of whether the message is logged or not.
If you are worried about speed, then you should use
info(Supplier)This way you will not incur the cost of parameter construction if debugging is disabled for
log.- Returns:
- boolean -
trueif this Logger is info enabled,falseotherwise.
-
isEnabledFor
boolean isEnabledFor(Level level)
Check whether this logger is enabled for a givenLevelpassed as parameter. See alsoisDebugEnabled().- Parameters:
level- the log level to check for.- Returns:
- boolean True if this category is enabled for
level.
-
log
void log(Level level, String message)
Log a message at a particular level. This generic form is intended to be used by wrappers.- Parameters:
level- the level to log at.message- the message to log.
-
log
void log(Level level, String message, Throwable t)
Log a message at a particular level. This generic form is intended to be used by wrappers.- Parameters:
level- the level to log at.message- the message to log.t- an optional exception to log with the message.
-
info
default void info(Supplier<String> logMessage, Throwable t)
Similar toinfo(Supplier)but with an optional exception that should be logged
-
debug
default void debug(Supplier<String> logMessage, Throwable t)
Similar todebug(Supplier)but with an optional exception that should be logged
-
-