public class LoggerOutputStream extends OutputStream
final LoggerOutputStream outputStream =
new LoggerOutputStream( logger, Priority.DEBUG );
final PrintStream output = new PrintStream( outputStream, true );
System.setOut( output );
| Modifier and Type | Field and Description |
|---|---|
private boolean |
m_closed |
private Logger |
m_logger |
private StringBuffer |
m_output |
private Priority |
m_priority |
| Constructor and Description |
|---|
LoggerOutputStream(Logger logger,
Priority priority)
Construct OutputStreamLogger to write to a particular logger at a particular priority.
|
| Modifier and Type | Method and Description |
|---|---|
private void |
checkValid()
Make sure stream is valid.
|
void |
close()
Shutdown stream.
|
void |
flush()
Flush data to underlying logger.
|
void |
write(int data)
Write a single byte of data to output stream.
|
write, writeprivate final Logger m_logger
private final Priority m_priority
private final StringBuffer m_output
private boolean m_closed
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOException - if an error occurs while closing the streampublic void write(int data)
throws IOException
write in class OutputStreamdata - the byte of dataIOException - if an error occurspublic void flush()
throws IOException
flush in interface Flushableflush in class OutputStreamIOException - if an error occursprivate void checkValid()
throws IOException
IOException - if an error occursCopyright © 2003-2004 The Apache Software Foundation. All Rights Reserved.