its.util
Class ErrorLogger

java.lang.Object
  extended byits.util.ErrorLogger

public class ErrorLogger
extends java.lang.Object


Field Summary
protected  boolean toStderr
           
 
Constructor Summary
ErrorLogger()
           
ErrorLogger(java.lang.String filename, boolean toStderr)
           
ErrorLogger(java.lang.String filename, boolean toStderr, boolean appendExisting)
          Creates a new ErrorLogger object.
 
Method Summary
 void changeFileName(java.lang.String newLogFileName)
          Changes the name of the log file.
static void debug(java.lang.String message)
          This static method can be used to place a message in the global error log.
static void debug(java.lang.Throwable t)
           
static void fatal(java.lang.String message)
          This static method can be used to place a message in the global error log.
static void fatal(java.lang.Throwable t)
           
static void status(java.lang.String message)
          This static method can be used to place a message in the global error log.
static void status(java.lang.Throwable t)
           
static void warning(java.lang.String message)
          This static method can be used to place a message in the global error log.
static void warning(java.lang.Throwable t)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

toStderr

protected boolean toStderr
Constructor Detail

ErrorLogger

public ErrorLogger()

ErrorLogger

public ErrorLogger(java.lang.String filename,
                   boolean toStderr)

ErrorLogger

public ErrorLogger(java.lang.String filename,
                   boolean toStderr,
                   boolean appendExisting)
Creates a new ErrorLogger object. Only a single instance of ErrorLogger can be created. A reference to this instance is saved and is used by the static log entry routines. This way, the top-level application class can decide what kind of logging to provide, and all other classes can add information to the log through the static method. If a file called "its.properties" is present in the root directory, and assigns a value to the property "itslogdir", the file created for this error log will be placed in the directory it names.

Parameters:
filename - the filename of the log file
toStderr - indicates whether to print log messages to System.err
appendExisting - indicates whether to append to any existing log file
Method Detail

debug

public static void debug(java.lang.String message)
This static method can be used to place a message in the global error log. A date, time, and priority accompany the logged message. If the top-level application class hasn't created an instance of ErrorLogger, nothing happens. Messages with DEBUG priority are for debugging purposes only and should be removed from the released program.

Parameters:
message - the message to append to the log file

status

public static void status(java.lang.String message)
This static method can be used to place a message in the global error log. A date, time, and priority accompany the logged message. If the top-level application class hasn't created an instance of ErrorLogger, nothing happens. Messages with STATUS priority describe the normal, expected operation of the program.

Parameters:
message - the message to append to the log file

warning

public static void warning(java.lang.String message)
This static method can be used to place a message in the global error log. A date, time, and priority accompany the logged message. If the top-level application class hasn't created an instance of ErrorLogger, nothing happens. Messages with WARNING priority indicate that the program is in danger of crashing or behaving incorrectly.

Parameters:
message - the message to append to the log file

fatal

public static void fatal(java.lang.String message)
This static method can be used to place a message in the global error log. A date, time, and priority accompany the logged message. If the top-level application class hasn't created an instance of ErrorLogger, nothing happens. Messages with FATAL priority are logged immediately before the program exits. It's a good idea to catch unhandled Errors/Exceptions at the top level of a program and attempt to log a FATAL message.

Parameters:
message - the message to append to the log file

debug

public static void debug(java.lang.Throwable t)

status

public static void status(java.lang.Throwable t)

warning

public static void warning(java.lang.Throwable t)

fatal

public static void fatal(java.lang.Throwable t)

changeFileName

public void changeFileName(java.lang.String newLogFileName)
Changes the name of the log file.