com.go.trove.log
Class LogEventParsingOutputStream

java.lang.Object
  |
  +--java.io.OutputStream
        |
        +--com.go.trove.log.LogEventParsingOutputStream

public class LogEventParsingOutputStream
extends java.io.OutputStream

LogEventParsingOutputStream parses the data written to it and converts it to LogEvent objects. Add a LogListener to intercept LogEvents. Events are parsed based on newline characters (LF, CRLF or CR) or a switch to a different thread.

Version:
14 , 9/07/00
Author:
Brian S O'Neill

Constructor Summary
LogEventParsingOutputStream(Log source, int type)
           
LogEventParsingOutputStream(Log source, int type, java.lang.String encoding)
           
 
Method Summary
 void addLogListener(LogListener listener)
           
 void close()
           
 boolean isEnabled()
          Returning false discards written data, and events are not generated.
 void removeLogListener(LogListener listener)
           
 void write(byte[] array, int off, int len)
           
 void write(int b)
           
 
Methods inherited from class java.io.OutputStream
flush, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogEventParsingOutputStream

public LogEventParsingOutputStream(Log source,
                                   int type)
Parameters:
source - Source object to create events with.
type - Type of events to create.

LogEventParsingOutputStream

public LogEventParsingOutputStream(Log source,
                                   int type,
                                   java.lang.String encoding)
Parameters:
source - Source object to create events with.
type - Type of events to create.
encoding - Character encoding of bytes.
Method Detail

addLogListener

public void addLogListener(LogListener listener)

removeLogListener

public void removeLogListener(LogListener listener)

write

public void write(int b)
           throws java.io.IOException
Overrides:
write in class java.io.OutputStream

write

public void write(byte[] array,
                  int off,
                  int len)
           throws java.io.IOException
Overrides:
write in class java.io.OutputStream

close

public void close()
           throws java.io.IOException
Overrides:
close in class java.io.OutputStream

isEnabled

public boolean isEnabled()
Returning false discards written data, and events are not generated. Default implementation always returns true.