edu.rice.cs.plt.debug
Class FileLogSink

java.lang.Object
  extended by edu.rice.cs.plt.debug.TextLogSink
      extended by edu.rice.cs.plt.debug.IndentedTextLogSink
          extended by edu.rice.cs.plt.debug.FileLogSink
All Implemented Interfaces:
LogSink, Closeable

public class FileLogSink
extends IndentedTextLogSink

A log sink that writes tagged, indented text to a file. The file is not opened until required for logging, and is closed on program exit.


Nested Class Summary
 
Nested classes/interfaces inherited from interface edu.rice.cs.plt.debug.LogSink
LogSink.EndMessage, LogSink.ErrorMessage, LogSink.Message, LogSink.MessageVisitor<T>, LogSink.StackMessage, LogSink.StandardMessage, LogSink.StartMessage, LogSink.ValueMessage
 
Constructor Summary
FileLogSink(File f)
           
FileLogSink(File f, boolean closeOnExit)
           
FileLogSink(File f, int idealLineWidth)
           
FileLogSink(File f, int idealLineWidth, boolean closeOnExit)
           
FileLogSink(File f, String charset)
           
FileLogSink(File f, String charset, boolean closeOnExit)
           
FileLogSink(File f, String charset, int idealLineWidth)
           
FileLogSink(File f, String charset, int idealLineWidth, boolean closeOnExit)
           
FileLogSink(String filename)
           
 
Method Summary
 void close()
          Close the file stream.
protected  BufferedWriter writer(LogSink.Message m)
          Get a BufferedWriter for outputting the given message.
 
Methods inherited from class edu.rice.cs.plt.debug.IndentedTextLogSink
write, writeEnd, writeStart
 
Methods inherited from class edu.rice.cs.plt.debug.TextLogSink
formatLocation, formatLocation, formatThread, formatTime, log, logEnd, logError, logStack, logStart
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileLogSink

public FileLogSink(String filename)

FileLogSink

public FileLogSink(File f)

FileLogSink

public FileLogSink(File f,
                   int idealLineWidth)

FileLogSink

public FileLogSink(File f,
                   boolean closeOnExit)

FileLogSink

public FileLogSink(File f,
                   int idealLineWidth,
                   boolean closeOnExit)

FileLogSink

public FileLogSink(File f,
                   String charset)

FileLogSink

public FileLogSink(File f,
                   String charset,
                   boolean closeOnExit)

FileLogSink

public FileLogSink(File f,
                   String charset,
                   int idealLineWidth)

FileLogSink

public FileLogSink(File f,
                   String charset,
                   int idealLineWidth,
                   boolean closeOnExit)
Method Detail

writer

protected BufferedWriter writer(LogSink.Message m)
Description copied from class: IndentedTextLogSink
Get a BufferedWriter for outputting the given message.

Specified by:
writer in class IndentedTextLogSink

close

public void close()
           throws IOException
Close the file stream.

Throws:
IOException