edu.rice.cs.plt.debug
Class SystemOutLogSink

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.SystemOutLogSink
All Implemented Interfaces:
LogSink, Closeable

public class SystemOutLogSink
extends IndentedTextLogSink

A log sink that writes tagged, indented text to System.out. Automatically changes the destination stream after updates are made to System.out.


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
SystemOutLogSink()
          Create a log sink to System.err using the platform's default charset.
SystemOutLogSink(int idealLineWidth)
          Create a log sink to System.err using the platform's default charset and the given line width.
SystemOutLogSink(String charsetName)
          Create a log sink to System.err using the given charset.
SystemOutLogSink(String charsetName, int idealLineWidth)
          Create a log to System.err using the given charset and line width.
 
Method Summary
 void close()
           
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

SystemOutLogSink

public SystemOutLogSink()
Create a log sink to System.err using the platform's default charset.


SystemOutLogSink

public SystemOutLogSink(String charsetName)
                 throws UnsupportedEncodingException
Create a log sink to System.err using the given charset.

Throws:
UnsupportedEncodingException

SystemOutLogSink

public SystemOutLogSink(int idealLineWidth)
Create a log sink to System.err using the platform's default charset and the given line width.


SystemOutLogSink

public SystemOutLogSink(String charsetName,
                        int idealLineWidth)
                 throws UnsupportedEncodingException
Create a log to System.err using the given charset and line width.

Throws:
UnsupportedEncodingException
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
Throws:
IOException