com.taursys.debug
Interface LoggerAdapter

All Known Implementing Classes:
SimpleLogger

public interface LoggerAdapter

LoggerAdapter is an Adapter used by the Debug Singleton to log debug information. This interface is based on the features of Log4J, so it is easily used with that system. You can implement this interface for almost any logging system.

Version:
1.0
Author:
Marty Phelan

Method Summary
 void debug(java.lang.Object message)
          Writes the given DEBUG message to the log if the DEBUG logging level is enabled
 void debug(java.lang.Object message, java.lang.Throwable t)
          Writes the given DEBUG message and stack trace to the log if the DEBUG logging level is enabled
 void error(java.lang.Object message)
          Writes the given ERROR message to the log if the ERROR logging level is enabled
 void error(java.lang.Object message, java.lang.Throwable t)
          Writes the given ERROR message and stack trace to the log if the ERROR logging level is enabled
 void fatal(java.lang.Object message)
          Writes the given FATAL message to the log if the FATAL logging level is enabled
 void fatal(java.lang.Object message, java.lang.Throwable t)
          Writes the given FATAL message and stack trace to the log if the FATAL logging level is enabled
 void info(java.lang.Object message)
          Writes the given INFO message to the log if the INFO logging level is enabled
 void info(java.lang.Object message, java.lang.Throwable t)
          Writes the given INFO message and stack trace to the log if the INFO logging level is enabled
 boolean isDebugEnabled()
          Indicates whether or not the DEBUG level is enabled for logging.
 boolean isEnabledFor(int level)
          Indicates whether or not the given level is enabled for logging.
 boolean isInfoEnabled()
          Indicates whether or not the INFO level is enabled for logging.
 void log(int level, java.lang.Object message)
          Writes the given level message to the log if the given logging level is enabled
 void log(int level, java.lang.Object message, java.lang.Throwable t)
          Writes the given level message and stack trace to the log if the given logging level is enabled
 void warn(java.lang.Object message)
          Writes the given WARN message to the log if the WARN logging level is enabled
 void warn(java.lang.Object message, java.lang.Throwable t)
          Writes the given WARN message and stack trace to the log if the WARN logging level is enabled
 

Method Detail

debug

public void debug(java.lang.Object message)
Writes the given DEBUG message to the log if the DEBUG logging level is enabled

Parameters:
message - is an object which contains the message to log

debug

public void debug(java.lang.Object message,
                  java.lang.Throwable t)
Writes the given DEBUG message and stack trace to the log if the DEBUG logging level is enabled

Parameters:
message - is an object which contains the message to log
t - throwable to be rendered using printStackTrace

info

public void info(java.lang.Object message)
Writes the given INFO message to the log if the INFO logging level is enabled

Parameters:
message - is an object which contains the message to log

info

public void info(java.lang.Object message,
                 java.lang.Throwable t)
Writes the given INFO message and stack trace to the log if the INFO logging level is enabled

Parameters:
message - is an object which contains the message to log
t - throwable to be rendered using printStackTrace

warn

public void warn(java.lang.Object message)
Writes the given WARN message to the log if the WARN logging level is enabled

Parameters:
message - is an object which contains the message to log

warn

public void warn(java.lang.Object message,
                 java.lang.Throwable t)
Writes the given WARN message and stack trace to the log if the WARN logging level is enabled

Parameters:
message - is an object which contains the message to log
t - throwable to be rendered using printStackTrace

error

public void error(java.lang.Object message)
Writes the given ERROR message to the log if the ERROR logging level is enabled

Parameters:
message - is an object which contains the message to log

error

public void error(java.lang.Object message,
                  java.lang.Throwable t)
Writes the given ERROR message and stack trace to the log if the ERROR logging level is enabled

Parameters:
message - is an object which contains the message to log
t - throwable to be rendered using printStackTrace

fatal

public void fatal(java.lang.Object message)
Writes the given FATAL message to the log if the FATAL logging level is enabled

Parameters:
message - is an object which contains the message to log

fatal

public void fatal(java.lang.Object message,
                  java.lang.Throwable t)
Writes the given FATAL message and stack trace to the log if the FATAL logging level is enabled

Parameters:
message - is an object which contains the message to log
t - throwable to be rendered using printStackTrace

isDebugEnabled

public boolean isDebugEnabled()
Indicates whether or not the DEBUG level is enabled for logging.

Returns:
true if DEBUG level is enabled

isInfoEnabled

public boolean isInfoEnabled()
Indicates whether or not the INFO level is enabled for logging.

Returns:
true if INFO level is enabled

isEnabledFor

public boolean isEnabledFor(int level)
Indicates whether or not the given level is enabled for logging.

Parameters:
level - to check if enabled
Returns:
true if given level is enabled

log

public void log(int level,
                java.lang.Object message)
Writes the given level message to the log if the given logging level is enabled

Parameters:
level - of log message
message - is an object which contains the message to log

log

public void log(int level,
                java.lang.Object message,
                java.lang.Throwable t)
Writes the given level message and stack trace to the log if the given logging level is enabled

Parameters:
level - of log message
message - is an object which contains the message to log
t - throwable to be rendered using printStackTrace


Copyright © 2007 Martin T Phelan. All Rights Reserved.