com.redwood.scheduler.infrastructure.logging
Interface Logger


public interface Logger

Redwood Logging Interface.


Method Summary
 void debug(String message)
          Log a message object with the DEBUG level to the server logs.
 void debug(String message, Throwable t)
          Log a message object, along with the associated exception, with the DEBUG level to the server logs.
 void error(String message)
          Log a message object with the ERROR level to the server logs.
 void error(String message, Throwable t)
          Log a message object, along with the associated exception, with the ERROR level to the server logs.
 void fatal(String message)
          Log a message object with the FATAL level to the server logs.
 void fatal(String message, Throwable t)
          Log a message object, along with the associated exception, with the FATAL level to the server logs.
 void info(String message)
          Log a message object with the INFO level to the server logs.
 void info(String message, Throwable t)
          Log a message object, along with the associated exception, with the INFO level to the server logs.
 boolean isDebugEnabled()
          Check whether this logger is enabled for the DEBUG Level.
 boolean isEnabledFor(Level level)
          Check whether this logger is enabled for a given Level passed as parameter.
 boolean isInfoEnabled()
          Check whether this logger is enabled for the INFO 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 the WARN level to the server logs.
 void warn(String message, Throwable t)
          Log a message object, along with the associated exception, with the WARN level to the server logs.
 

Field Detail

COPYRIGHT_MESSAGE_LOGGER

public static final String COPYRIGHT_MESSAGE_LOGGER

ID_LOGGER

public static final String ID_LOGGER
Method Detail

debug

public void debug(String message)
Log a message object with the DEBUG level to the server logs. This method first checks if this Logger is DEBUG enabled by comparing the level of this Logger with the DEBUG level. If this Logger is DEBUG enabled, then it logs the message.

Parameters:
message - the message to log.

debug

public void debug(String message,
                  Throwable t)
Log a message object, along with the associated exception, with the DEBUG 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

public void info(String message)
Log a message object with the INFO level to the server logs. This method first checks if this Logger is INFO enabled by comparing the level of this Logger with the INFO level. If this Logger is INFO enabled, then it logs the message.

Parameters:
message - the message to log.

info

public void info(String message,
                 Throwable t)
Log a message object, along with the associated exception, with the INFO 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

public void warn(String message)
Log a message object with the WARN level to the server logs. This method first checks if this Logger is WARN enabled by comparing the level of this Logger with the WARN level. If this Logger is WARN enabled, then it logs the message.

Parameters:
message - the message to log.

warn

public void warn(String message,
                 Throwable t)
Log a message object, along with the associated exception, with the WARN 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

public void error(String message)
Log a message object with the ERROR level to the server logs. This method first checks if this Logger is ERROR enabled by comparing the level of this Logger with the ERROR level. If this Logger is ERROR enabled, then it logs the message.

Parameters:
message - the message to log.

error

public void error(String message,
                  Throwable t)
Log a message object, along with the associated exception, with the ERROR 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

public void fatal(String message)
Log a message object with the FATAL level to the server logs. This method first checks if this Logger is FATAL enabled by comparing the level of this Logger with the FATAL level. If this Logger is FATAL enabled, then it logs the message.

Parameters:
message - the message to log.

fatal

public void fatal(String message,
                  Throwable t)
Log a message object, along with the associated exception, with the FATAL 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

public boolean isDebugEnabled()
Check whether this logger is enabled for the DEBUG 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, concatenatiion in this case, regardless of whether the message is logged or not.

If you are worried about speed, then you should write

 if (log.isDebugEnabled())
 {
   log.debug("This is entry number: " + i);
 }
 

This way you will not incur the cost of parameter construction if debugging is disabled for log. On the other hand, if the log is debug enabled, you will incur the cost of evaluating whether the Logger is debug enabled twice. Once in isDebugEnabled and once in the debug. This is an insignificant overhead since evaluating a Logger takes about 1%% of the time it takes to actually log.

Returns:
boolean - true if this Logger is debug enabled, false otherwise.

isInfoEnabled

public boolean isInfoEnabled()
Check whether this logger is enabled for the INFO 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, concatenatiion in this case, regardless of whether the message is logged or not.

If you are worried about speed, then you should write

 if (log.isInfoEnabled())
 {
   log.debug("This is entry number: " + i);
 }
 

This way you will not incur the cost of parameter construction if debugging is disabled for log. On the other hand, if the log is debug enabled, you will incur the cost of evaluating whether the Logger is debug enabled twice. Once in isInfoEnabled and once in the debug. This is an insignificant overhead since evaluating a Logger takes about 1%% of the time it takes to actually log.

Returns:
boolean - true if this Logger is debug enabled, false otherwise.

isEnabledFor

public boolean isEnabledFor(Level level)
Check whether this logger is enabled for a given Level passed as parameter. See also isDebugEnabled().

Parameters:
level - the log level to check for.
Returns:
boolean True if this category is enabled for level.

log

public 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

public 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.