org.liquidsite.util.log
Class Log

java.lang.Object
  extended byorg.liquidsite.util.log.Log

public class Log
extends java.lang.Object

An error and debug log. This class encapsulates the standard logging in JDK 1.4 to provide some convenience methods and define the log levels more adequately for this application.


Constructor Summary
Log(java.lang.Class cls)
          Creates a new log.
Log(java.lang.Object obj)
          Creates a new log.
 
Method Summary
 void error(java.lang.String message)
          Logs an error message.
 void error(java.lang.String message, java.lang.Throwable thrown)
          Logs an error message.
 void info(java.lang.String message)
          Logs an informative message.
 void info(java.lang.String message, java.lang.Throwable thrown)
          Logs an informative message.
static void initialize(java.io.File file)
          Initializes the logging subsystem with a configuration file.
 void trace(java.lang.String message)
          Logs a trace message.
 void trace(java.lang.String message, java.lang.Throwable thrown)
          Logs a trace message.
 void warning(java.lang.String message)
          Logs a warning message.
 void warning(java.lang.String message, java.lang.Throwable thrown)
          Logs a warning message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Log

public Log(java.lang.Class cls)
Creates a new log. The class name will be used as the log name.

Parameters:
cls - the class to log

Log

public Log(java.lang.Object obj)
Creates a new log. The object class name will be used as the log name.

Parameters:
obj - the object to log
Method Detail

initialize

public static void initialize(java.io.File file)
                       throws java.io.IOException
Initializes the logging subsystem with a configuration file.

Parameters:
file - the logging configuration file
Throws:
java.io.IOException - it the configuration file couldn't be read

error

public final void error(java.lang.String message)
Logs an error message. An error message is logged for errors that require attention from a system administrator. In the typical case, some kind of error message is also presented to the user.

Parameters:
message - the log message

error

public final void error(java.lang.String message,
                        java.lang.Throwable thrown)
Logs an error message. An error message is logged for errors that require attention from a system administrator. In the typical case, some kind of error message is also presented to the user.

Parameters:
message - the log message
thrown - the throwable to log

warning

public final void warning(java.lang.String message)
Logs a warning message. A warning message is logged for errors that were recovered automatically or for anomalies in the input. In the typical case, the error was handled by using fallback routines or similar.

Parameters:
message - the log message

warning

public final void warning(java.lang.String message,
                          java.lang.Throwable thrown)
Logs a warning message. A warning message is logged for errors that were recovered automatically or for anomalies in the input. In the typical case, the error was handled by using fallback routines or similar.

Parameters:
message - the log message
thrown - the throwable to log

info

public final void info(java.lang.String message)
Logs an informative message. An info message is logged when performing certain operations that may be interresting to track for a system administrator. In the typical case, an info message is used to report the status when communicating with external systems.

Parameters:
message - the log message

info

public final void info(java.lang.String message,
                       java.lang.Throwable thrown)
Logs an informative message. An info message is logged when performing certain operations that may be interresting to track for a system administrator. In the typical case, an info message is used to report the status when communicating with external systems.

Parameters:
message - the log message
thrown - the throwable to log

trace

public final void trace(java.lang.String message)
Logs a trace message. A trace message is logged for debugging normal operation. In the typical case, a trace message is used to log method calls.

Parameters:
message - the log message

trace

public final void trace(java.lang.String message,
                        java.lang.Throwable thrown)
Logs a trace message. A trace message is logged for debugging normal operation. In the typical case, a trace message is used to log method calls.

Parameters:
message - the log message
thrown - the throwable to log