com.go.trove.log
Class LogEventParsingWriter

java.lang.Object
  |
  +--java.io.Writer
        |
        +--com.go.trove.log.LogEventParsingWriter

public class LogEventParsingWriter
extends java.io.Writer

LogEventParsingWriter 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

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

Constructor Detail

LogEventParsingWriter

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

LogEventParsingWriter

public LogEventParsingWriter(Log source,
                             int type,
                             java.lang.Object lock)
Parameters:
source - Source object to create events with.
type - Type of events to create.
lock - Synchronization lock.
Method Detail

addLogListener

public void addLogListener(LogListener listener)

removeLogListener

public void removeLogListener(LogListener listener)

write

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

flush

public void flush()
           throws java.io.IOException
Overrides:
flush in class java.io.Writer

close

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

isEnabled

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