Interface Logger
-
- All Known Subinterfaces:
JobLogger
,com.redwood.scheduler.infrastructure.logging.LoggerSetLevel
,TriggerLogger
public interface Logger
Redwood logging.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
debug(String message)
Log a message object with theDEBUG
level to the server logs.void
debug(String message, Throwable t)
Log a message object, along with the associated exception, with theDEBUG
level to the server logs.default void
debug(Supplier<String> logMessage)
Log a message object with theDEBUG
level to the server logs.default void
debug(Supplier<String> logMessage, Throwable t)
Similar todebug(Supplier)
but with an optional exception that should be loggedvoid
error(String message)
Log a message object with theERROR
level to the server logs.void
error(String message, Throwable t)
Log a message object, along with the associated exception, with theERROR
level to the server logs.void
fatal(String message)
Log a message object with theFATAL
level to the server logs.void
fatal(String message, Throwable t)
Log a message object, along with the associated exception, with theFATAL
level to the server logs.void
info(String message)
Log a message object with theINFO
level to the server logs.void
info(String message, Throwable t)
Log a message object, along with the associated exception, with theINFO
level to the server logs.default void
info(Supplier<String> logMessage)
Log a message object with theINFO
level.default void
info(Supplier<String> logMessage, Throwable t)
Similar toinfo(Supplier)
but with an optional exception that should be loggedboolean
isDebugEnabled()
Check whether this logger is enabled for theDEBUG
Level.boolean
isEnabledFor(Level level)
Check whether this logger is enabled for a givenLevel
passed as parameter.boolean
isInfoEnabled()
Check whether this logger is enabled for theINFO
Level.void
log(Level level, String message)
Log a message at a particular level.void
log(Level level, String message, Throwable t)
Log a message at a particular level.void
warn(String message)
Log a message object with theWARN
level to the server logs.void
warn(String message, Throwable t)
Log a message object, along with the associated exception, with theWARN
level to the server logs.
-
-
-
Method Detail
-
debug
void debug(String message)
Log a message object with theDEBUG
level to the server logs. This method first checks if this Logger isDEBUG
enabled by comparing the level of this Logger with theDEBUG
level. If this Logger isDEBUG
enabled, 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 theDEBUG
level 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 theINFO
level to the server logs. This method first checks if this Logger isINFO
enabled by comparing the level of this Logger with theINFO
level. If this Logger isINFO
enabled, 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 theINFO
level 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 theWARN
level to the server logs. This method first checks if this Logger isWARN
enabled by comparing the level of this Logger with theWARN
level. If this Logger isWARN
enabled, 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 theWARN
level 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 theERROR
level to the server logs. This method first checks if this Logger isERROR
enabled by comparing the level of this Logger with theERROR
level. If this Logger isERROR
enabled, 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 theERROR
level 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 theFATAL
level to the server logs. This method first checks if this Logger isFATAL
enabled by comparing the level of this Logger with theFATAL
level. If this Logger isFATAL
enabled, 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 theFATAL
level 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 theDEBUG
Level.This function is intended to lessen the computational cost of disabled log debug statements.
For some
log
Logger 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 -
true
if this Logger is debug enabled,false
otherwise.
-
isInfoEnabled
boolean isInfoEnabled()
Check whether this logger is enabled for theINFO
Level.This function is intended to lessen the computational cost of disabled log debug statements.
For some
log
LoggeLogger 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 -
true
if this Logger is info enabled,false
otherwise.
-
isEnabledFor
boolean isEnabledFor(Level level)
Check whether this logger is enabled for a givenLevel
passed 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
-
-