javatools.util
Class FileLog

java.lang.Object
  |
  +--javatools.util.FileLog
All Implemented Interfaces:
Log

public class FileLog
extends java.lang.Object
implements Log

A class for logging context specific messages to a file. Logged messages include the context (typically a class or subsystem), a date-time stamp a severity and supplied text. Entries are of the form:

yyyy.MM.dd HH:mm:ss :

If the system property "debugOn" is set to TRUE the messages with a severity of DEBUG will be logged. If the property is missing or is FALSE then DEBUG messages will be ignored.


Field Summary
 
Fields inherited from interface javatools.util.Log
DEBUG, ERROR, INFO, names, SEVERE, WARNING
 
Method Summary
 void debug(java.lang.String sID, java.lang.String sMessage)
          Puts a debug message in the log.
 void error(java.lang.String sID, java.lang.String sMessage)
          Puts an error message in the log.
 void finalize()
          Destroys this object.
 void info(java.lang.String sID, java.lang.String sMessage)
          Puts an info message in the log.
 void init(java.lang.String path, int debugLevel)
          Performs initializing.
 void log(int severity, java.lang.String sID, java.lang.String sMessage)
          Puts a new message in the log.
 void severe(java.lang.String sID, java.lang.String sMessage)
          Puts a severe error message in the log.
static FileLog singleton()
          Returns the instance for the FileLog.
 void warning(java.lang.String sID, java.lang.String sMessage)
          Puts a warning message in the log.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

singleton

public static FileLog singleton()
Returns the instance for the FileLog.

Returns:
The FileLog to be used.

init

public void init(java.lang.String path,
                 int debugLevel)
Performs initializing.

Parameters:
path - The path-to-the-file to be used ad a log.
debugLevel - The minimum severity to take care of.

log

public void log(int severity,
                java.lang.String sID,
                java.lang.String sMessage)
Puts a new message in the log.

Specified by:
log in interface Log
Parameters:
severity - The severity of the problem.
sID - The ID of the event.
sMessage - The message to save.

debug

public void debug(java.lang.String sID,
                  java.lang.String sMessage)
Puts a debug message in the log.

Specified by:
debug in interface Log
Parameters:
sID - The ID of the problem.
sMessage - The message to put in the log.

info

public void info(java.lang.String sID,
                 java.lang.String sMessage)
Puts an info message in the log.

Specified by:
info in interface Log
Parameters:
sID - The ID of the problem.
sMessage - The message to be put in the log.

warning

public void warning(java.lang.String sID,
                    java.lang.String sMessage)
Puts a warning message in the log.

Specified by:
warning in interface Log
Parameters:
sID - The ID of the problem.
sMessage - The message to be put in the log.

error

public void error(java.lang.String sID,
                  java.lang.String sMessage)
Puts an error message in the log.

Specified by:
error in interface Log
Parameters:
sID - The ID of the problem.
sMessage - The message to be put in the log.

severe

public void severe(java.lang.String sID,
                   java.lang.String sMessage)
Puts a severe error message in the log.

Specified by:
severe in interface Log
Parameters:
sID - The ID of the problem.
sMessage - The message to be put in the log.

finalize

public void finalize()
Destroys this object.

Overrides:
finalize in class java.lang.Object