com.ibm.etill.cashier
Class SimpleCashierTrace

java.lang.Object
  com.ibm.etill.cashier.SimpleCashierTrace
All Implemented Interfaces:
CashierTrace

public class SimpleCashierTrace
extends java.lang.Object
implements CashierTrace

SimpleCashierTrace provides a basic tracing facility for use by the cashier. SimpleCashierTrace writes its output to log files which are named for the date on which the trace was written. These log files will adhere to the following format:

 cashierlog.4-digit year_2-digit month_2-digit date .
 
For example,
   cashierlog.2001_01_31  for trace generated on January 31, 2001.
 
SimpleCashierTrace will write individual trace entries in the following format:
 thread name | date | name of class which created
 the entry | name of method which created the entry | trace message
 
SimpleCashierTrace will throw a RunTimeException if it encounters an IOException while writing to its output file.

Constructor Summary
SimpleCashierTrace(java.lang.String logDirectory)
Constructs a simple trace facility for use by the cashier.
Method Summary
void trace(java.lang.String classname, java.lang.String methodname, java.lang.String message)
Writes an entry to a trace file.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SimpleCashierTrace

public SimpleCashierTrace(java.lang.String logDirectory)
                   throws CashierException
Constructs a simple trace facility for use by the cashier.
Parameters:
logDirectory - directory to which to write the trace files.
Throws:
CashierException - if there is an error writing to the log directory.
Method Detail

trace

public void trace(java.lang.String classname,
                  java.lang.String methodname,
                  java.lang.String message)
Writes an entry to a trace file.
Specified by:
trace in interface CashierTrace
Parameters:
classname - name of the class in which this method is called.
methodname - name of the method in which this method is called.
message - text to be written to the file.

Feedback