qflib 0.98.0

de.qfs.lib.log
Interface LogWriter

All Known Implementing Classes:
StreamLogWriter, RemoteLogWriter

public interface LogWriter

A LogWriter is responsible for the final dispatch of LogEntries after they have passed through the chain of LogFilters. Possible uses are printing entries to System.err or some other stream or sending them via RMI to the LogServer qflog.

A LogWriter can also be combined with a LogUser to extract and distribute LogEntries directly from the filter chain. Thus filtering is decoupled from distribution.

Since:
0.98.0
Version:
$Revision: 1.2 $
Author:
Oliver Brandt, Gregor Schmid
See Also:
Log.setLogWriter(de.qfs.lib.log.LogWriter), LevelFilter

Method Summary
 void close()
          Close the LogWriter and free its resources, e.g. open Streams.
 LogFormat getFormat()
          Get the format the LogWriter uses to format LogEntries.
 void setFormat(LogFormat format)
          Set the format the LogWriter should use to format LogEntries.
 void write(LogEntry entry)
          Write one LogEntry.
 void write(LogEntry[] entries)
          Write an array of LogEntires in one go.
 

Method Detail

write

public void write(LogEntry entry)
Write one LogEntry.
Parameters:
entry - The entry to write.

write

public void write(LogEntry[] entries)
Write an array of LogEntires in one go. Clients of a LogWriter should use this method in preference to write(LogEntry), since the difference in performance can be enourmous (e.g. when using RMI).
Parameters:
entries - The entries to write.

close

public void close()
Close the LogWriter and free its resources, e.g. open Streams.

setFormat

public void setFormat(LogFormat format)
Set the format the LogWriter should use to format LogEntries.
Parameters:
format - The format to use.

getFormat

public LogFormat getFormat()
Get the format the LogWriter uses to format LogEntries.
Returns:
The format used by the LogWriter.

qflib 0.98.0