utilities.logging
Class Logger

java.lang.Object
  extended by utilities.logging.Logger

public class Logger
extends java.lang.Object

This object allows detailed logging to take place. It will write to a text file with a name passed to it's constructor and will automatically create one if one is not found.


Constructor Summary
Logger(java.lang.String logFileName, int logLevel)
           
 
Method Summary
 void clearLog()
          Empties the log file.
 int getLogLevel()
           
 void logIt(java.lang.Object caller, java.lang.String message, int statusCode)
          Method that does the actual writing to the log file.
 void setGUI(CommonGUI commonGUI)
          Links this object to a logging GUI
 void setLogLevel(int logLevel)
          Changes the logging level.
 void startLogging()
          Starts logging by getting a reference to the log file and creating one if it doesn't already exist.
 void stopLogging()
          Stops logging from occuring.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Logger

public Logger(java.lang.String logFileName,
              int logLevel)
Method Detail

startLogging

public void startLogging()
Starts logging by getting a reference to the log file and creating one if it doesn't already exist.


stopLogging

public void stopLogging()
Stops logging from occuring. All future log entries received will be ignored.


logIt

public void logIt(java.lang.Object caller,
                  java.lang.String message,
                  int statusCode)
Method that does the actual writing to the log file. In a Unixy type tradition, lower number status codes have higher priority. Messages with a status code above the statusCode argument passed to this object's constructor will be ignored.

Parameters:
caller - The object that calls this method
message - The message to be written
statusCode - The status code of the message. Lower is of greater importance.

clearLog

public void clearLog()
Empties the log file.


setLogLevel

public void setLogLevel(int logLevel)
Changes the logging level. Higher numbers are more verbose.

Parameters:
logLevel -

getLogLevel

public int getLogLevel()
Returns:
the current logging level

setGUI

public void setGUI(CommonGUI commonGUI)
Links this object to a logging GUI

Parameters:
commonGUI -