public class LoggerOutputStream extends OutputStream
final LoggerOutputStream outputStream = new LoggerOutputStream( logger, Priority.DEBUG ); final PrintStream output = new PrintStream( outputStream, true ); System.setOut( output );
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 |
---|---|
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, write
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
IOException
- if an error occurs while closing the streampublic void write(int data) throws IOException
write
in class OutputStream
data
- the byte of dataIOException
- if an error occurspublic void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
- if an error occursCopyright © 1997–2018. All rights reserved.