moj.util
Class Logger

java.lang.Object
  extended by moj.util.Logger

public class Logger
extends java.lang.Object

Basic logging class with customisable formatting.

Version:
2007-Sept-24
Author:
Martin Hassel

Constructor Summary
Logger(java.lang.String logfile)
          Open log file for appending log entries.
 
Method Summary
 java.lang.String formatEntry(java.lang.String entry)
          Formats a log entry.
 java.lang.String logEntry(java.lang.String entry)
          Writes the formatted log entry to the set log file and it.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Logger

public Logger(java.lang.String logfile)
Open log file for appending log entries.

Parameters:
logfile - name of the log file to write entries to
Method Detail

formatEntry

public java.lang.String formatEntry(java.lang.String entry)
Formats a log entry. Can be subclassed in order to customise the log entry format.

Parameters:
entry - log entry to format
Returns:
formatted log entry

logEntry

public java.lang.String logEntry(java.lang.String entry)
Writes the formatted log entry to the set log file and it.

Parameters:
entry - log entry to enter into log file
Returns:
the formatted log entry