net.spy.log
Class LoggingOutputStream

java.lang.Object
  extended byjava.io.OutputStream
      extended bynet.spy.log.LineGettingOutputStream
          extended bynet.spy.log.LoggingOutputStream

public class LoggingOutputStream
extends LineGettingOutputStream

An OutputStream that logs to a Logger.


Constructor Summary
LoggingOutputStream(String name)
          Get an instance of LoggingOutputStream.
LoggingOutputStream(String name, Level level)
          Get an instance of LoggingOutputStream.
 
Method Summary
static void main(String[] args)
          Redefine the outputs to use the logger.
protected  void processChunk(String chunk)
          Send the stuff to the logger.
static void redefineOutputs()
          Redefine stdout and stderr using new logging streams.
 
Methods inherited from class net.spy.log.LineGettingOutputStream
setErr, setOut, write, write
 
Methods inherited from class java.io.OutputStream
close, flush, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoggingOutputStream

public LoggingOutputStream(String name)
Get an instance of LoggingOutputStream.


LoggingOutputStream

public LoggingOutputStream(String name,
                           Level level)
Get an instance of LoggingOutputStream.

Method Detail

processChunk

protected void processChunk(String chunk)
Send the stuff to the logger.

Specified by:
processChunk in class LineGettingOutputStream
Parameters:
chunk -

redefineOutputs

public static void redefineOutputs()
Redefine stdout and stderr using new logging streams.


main

public static void main(String[] args)
Redefine the outputs to use the logger.