Package gov.usgs.util.logging
Class LoggingOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.ByteArrayOutputStream
-
- gov.usgs.util.logging.LoggingOutputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.Flushable
,java.lang.AutoCloseable
public class LoggingOutputStream extends java.io.ByteArrayOutputStream
An OutputStream that writes contents to a Logger upon each call to flush(). From http://blogs.sun.com/nickstephen/entry/java_redirecting_system_out_and
-
-
Constructor Summary
Constructors Constructor Description LoggingOutputStream(java.util.logging.Logger logger, java.util.logging.Level level)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
flush()
upon flush() write the existing contents of the OutputStream to the logger as a log record.
-
-
-
Method Detail
-
flush
public void flush() throws java.io.IOException
upon flush() write the existing contents of the OutputStream to the logger as a log record.- Specified by:
flush
in interfacejava.io.Flushable
- Overrides:
flush
in classjava.io.OutputStream
- Throws:
java.io.IOException
- in case of error
-
-