public class TraceWriter
extends Writer
| Modifier and Type | Field and Description |
|---|---|
private StringBuffer |
buf
Buffer to build up each line, flushed at newline
|
private int |
traceLevel
What level to output messages at
|
| Constructor and Description |
|---|
TraceWriter(int traceLevel)
Construct a TraceWriter, recording the Trace level that future
messages written to the stream will be output at.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the stream
|
void |
flush()
Flush any remaining output in the buffer
|
private void |
output(String str)
Output a string at the configured debug level
|
void |
write(char[] cbuf,
int off,
int len)
Write a series of characters.
|
private int traceLevel
private StringBuffer buf
public TraceWriter(int traceLevel)
traceLevel - Level to output future messages.public void write(char[] cbuf,
int off,
int len)
throws IOException
write in class WriterIOExceptionprivate void output(String str)
public void flush()
throws IOException
flush in interface Flushableflush in class WriterIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class WriterIOException