|
qflib 0.98.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.qfs.lib.log.StreamLogWriter
An implementation of the LogWriter interface that writes LogEntries
to a PrintStream
or a PrintWriter
.
Field Summary | |
protected boolean |
closed
Whether the StreamLogWriter has been closed. |
protected LogFormat |
format
The format used to print LogEntries. |
protected boolean |
mustClose
Whether the stream or writer must be closed in close . |
protected java.io.PrintStream |
ps
A stream to print to. |
protected java.io.PrintWriter |
pw
A writer to print to. |
Constructor Summary | |
StreamLogWriter()
Create a new StreamLogWriter that uses a DefaultLogFormat to print LogEntries to System.err. |
|
StreamLogWriter(LogFormat format)
Create a new StreamLogWriter that prints LogEntries to
System.err. |
|
StreamLogWriter(java.io.PrintStream ps,
boolean own)
Create a new StreamLogWriter that uses a DefaultLogFormat to print LogEntries to a stream. |
|
StreamLogWriter(java.io.PrintStream ps,
boolean own,
LogFormat format)
Create a new StreamLogWriter that prints LogEntries to
a stream. |
|
StreamLogWriter(java.io.PrintWriter pw,
boolean own)
Create a new StreamLogWriter that uses a DefaultLogFormat to print LogEntries to a writer. |
|
StreamLogWriter(java.io.PrintWriter pw,
boolean own,
LogFormat format)
Create a new StreamLogWriter that prints LogEntries to
a writer. |
Method Summary | |
void |
close()
Close the StreamLogWriter. |
LogFormat |
getFormat()
Get the format the StreamLogWriter uses to print LogEntries . |
void |
setFormat(LogFormat format)
Set the format to use for printing LogEntries . |
void |
write(LogEntry entry)
Write one LogEntry. |
void |
write(LogEntry[] entries)
Write an array of LogEntires in one go. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected LogFormat format
protected java.io.PrintStream ps
protected java.io.PrintWriter pw
protected boolean mustClose
close
.protected boolean closed
Constructor Detail |
public StreamLogWriter()
DefaultLogFormat
to print LogEntries
to System.err.public StreamLogWriter(LogFormat format)
LogEntries
to
System.err.format
- The format used to print LogEntries.public StreamLogWriter(java.io.PrintStream ps, boolean own)
DefaultLogFormat
to print LogEntries
to a stream.ps
- The stream to print to.own
- Whether the stream is owned by the StreamLogWriter
and should be closed when the StreamLogWriter is
closed.public StreamLogWriter(java.io.PrintStream ps, boolean own, LogFormat format)
LogEntries
to
a stream.ps
- The stream to print to.own
- Whether the stream is owned by the StreamLogWriter
and should be closed when the StreamLogWriter is
closed.format
- The format used to print LogEntries.public StreamLogWriter(java.io.PrintWriter pw, boolean own)
DefaultLogFormat
to print LogEntries
to a writer.pw
- The writer to print to.own
- Whether the writer is owned by the StreamLogWriter
and should be closed when the StreamLogWriter is
closed.public StreamLogWriter(java.io.PrintWriter pw, boolean own, LogFormat format)
LogEntries
to
a writer.pw
- The writer to print to.own
- Whether the writer is owned by the StreamLogWriter
and should be closed when the StreamLogWriter is
closed.format
- The format used to print LogEntries.Method Detail |
public void write(LogEntry entry)
write
in interface LogWriter
entry
- The entry to write.public void write(LogEntry[] entries)
write(LogEntry)
, since it is more efficient.write
in interface LogWriter
entries
- The entries to write.public void close()
close
in interface LogWriter
public final LogFormat getFormat()
LogEntries
.getFormat
in interface LogWriter
public final void setFormat(LogFormat format)
LogEntries
.setFormat
in interface LogWriter
format
- The format to set.
|
qflib 0.98.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |