edu.toronto.cs.util
Class Logger

java.lang.Object
  extended by edu.toronto.cs.util.Logger

public class Logger
extends java.lang.Object

This class allows to create and maintain logs for java programs.


Field Summary
protected  org.apache.log4j.Category log
          Category assigned to this particular logger.
static java.lang.String LOG_FILENAME
           
 
Constructor Summary
Logger(java.lang.String catname)
          Make a logger corresponding to the specified category.
 
Method Summary
 void debug(java.lang.Object message)
          Request to log a debugging message.
 void debug(java.lang.Object message, java.lang.Throwable t)
          Request to log a debugging message with the stack trace of the Throwable t passed as parameter.
 void debug(java.lang.Throwable t)
          Log with DEBUG priority the stack trace of the Throwable t passed as parameter.
 void error(java.lang.Object message)
          Request to log an error message.
 void error(java.lang.Object message, java.lang.Throwable t)
          Request to log an error message with the stack trace of the Throwable t passed as parameter.
 void error(java.lang.Throwable t)
          Log with ERROR priority the stack trace of the Throwable t passed as parameter.
 void fatal(java.lang.Object message)
          Request to log a fatal error message.
 void fatal(java.lang.Object message, java.lang.Throwable t)
          Request to log a fatal error message with the stack trace of the Throwable t passed as parameter.
 void fatal(java.lang.Throwable t)
          Log with FATAL priority the stack trace of the Throwable t passed as parameter.
 void info(java.lang.Object message)
          Request to log some information.
 void info(java.lang.Object message, java.lang.Throwable t)
          Request to log an informative message with the stack trace of the Throwable t passed as parameter.
 void info(java.lang.Throwable t)
          Log with INFO priority the stack trace of the Throwable t passed as parameter.
 void warn(java.lang.Object message)
          Request to log a warning message.
 void warn(java.lang.Object message, java.lang.Throwable t)
          Request to log a warning message with the stack trace of the Throwable t passed as parameter.
 void warn(java.lang.Throwable t)
          Log with WARN priority the stack trace of the Throwable t passed as parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG_FILENAME

public static final java.lang.String LOG_FILENAME
See Also:
Constant Field Values

log

protected org.apache.log4j.Category log
Category assigned to this particular logger.

Constructor Detail

Logger

public Logger(java.lang.String catname)
Make a logger corresponding to the specified category.

Parameters:
catname - the name of the logging category (usually just the class name).
Method Detail

debug

public void debug(java.lang.Object message)
Request to log a debugging message.

Parameters:
message - the debugging message to log.

debug

public void debug(java.lang.Object message,
                  java.lang.Throwable t)
Request to log a debugging message with the stack trace of the Throwable t passed as parameter.

Parameters:
message - the debugging message to log.
t - the exception to log, including its stack trace.

debug

public void debug(java.lang.Throwable t)
Log with DEBUG priority the stack trace of the Throwable t passed as parameter.

Parameters:
t - the exception to log, including its stack trace.

info

public void info(java.lang.Object message)
Request to log some information.

Parameters:
message - the information (message) to log.

info

public void info(java.lang.Object message,
                 java.lang.Throwable t)
Request to log an informative message with the stack trace of the Throwable t passed as parameter.

Parameters:
message - the information (message) to log.
t - the exception to log, including its stack trace.

info

public void info(java.lang.Throwable t)
Log with INFO priority the stack trace of the Throwable t passed as parameter.

Parameters:
t - the exception to log, including its stack trace.

warn

public void warn(java.lang.Object message)
Request to log a warning message.

Parameters:
message - the warning message to log.

warn

public void warn(java.lang.Object message,
                 java.lang.Throwable t)
Request to log a warning message with the stack trace of the Throwable t passed as parameter.

Parameters:
message - the warning message to log.
t - the exception to log, including its stack trace.

warn

public void warn(java.lang.Throwable t)
Log with WARN priority the stack trace of the Throwable t passed as parameter.

Parameters:
t - the exception to log, including its stack trace.

error

public void error(java.lang.Object message)
Request to log an error message.

Parameters:
message - the error message to log.

error

public void error(java.lang.Object message,
                  java.lang.Throwable t)
Request to log an error message with the stack trace of the Throwable t passed as parameter.

Parameters:
message - the error message to log.
t - the exception to log, including its stack trace.

error

public void error(java.lang.Throwable t)
Log with ERROR priority the stack trace of the Throwable t passed as parameter.

Parameters:
t - the exception to log, including its stack trace.

fatal

public void fatal(java.lang.Object message)
Request to log a fatal error message.

Parameters:
message - the fatal error message to log.

fatal

public void fatal(java.lang.Object message,
                  java.lang.Throwable t)
Request to log a fatal error message with the stack trace of the Throwable t passed as parameter.

Parameters:
message - the fatal error message to log.
t - the exception to log, including its stack trace.

fatal

public void fatal(java.lang.Throwable t)
Log with FATAL priority the stack trace of the Throwable t passed as parameter.

Parameters:
t - the exception to log, including its stack trace.