ostore.util
Class Logger

java.lang.Object
  |
  +--ostore.util.Logger

public class Logger
extends Object

A logging utility.

Each stage should open a Logger with a good filename. Try the ${InternalLog} variable in run-experiment.

If two stages open the same Logger, their output will be interleaved, but individual entries will remain atomic.

The backing file is wrapped in a BufferedWriter for efficient writes. Therefore new entries may not appear in the file instantly.

Version:
$Id: Logger.java,v 1.3 2002/05/03 19:20:33 geels Exp $
Author:
Dennis Geels

Method Summary
 void flush()
          Flushes the log to disk.
static void main(String[] args)
           
static Logger open(String filename)
          Returns the Logger for the specified file.
 void write(String entry)
          Appends an entry to the log file, adding a timestamp and newline.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

open

public static Logger open(String filename)
                   throws IOException
Returns the Logger for the specified file. This method will create a new Logger if necessary.

IOException

main

public static void main(String[] args)
                 throws IOException
IOException

write

public void write(String entry)
Appends an entry to the log file, adding a timestamp and newline.

IOExceptions are ignored, for laziness.


flush

public void flush()
Flushes the log to disk.