Package org.apache.openjpa.lib.log
Class LogOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.ByteArrayOutputStream
-
- org.apache.openjpa.lib.log.LogOutputStream
-
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
public class LogOutputStream extends ByteArrayOutputStream
Many standard components log toOutputStreams. This wrapper class extends theByteArrayOutputStreamclass and writes all given data to an underlyingLoginstance whenever it is flushed and the internally held byte array contains a newline.- Author:
- Abe White, Marc Prud'hommeaux
-
-
Field Summary
-
Fields inherited from class java.io.ByteArrayOutputStream
buf, count
-
-
Constructor Summary
Constructors Constructor Description LogOutputStream(Log log, int level)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidflush()-
Methods inherited from class java.io.ByteArrayOutputStream
close, reset, size, toByteArray, toString, toString, toString, toString, write, write, writeBytes, writeTo
-
Methods inherited from class java.io.OutputStream
nullOutputStream, write
-
-
-
-
Constructor Detail
-
LogOutputStream
public LogOutputStream(Log log, int level)
Constructor.- Parameters:
log- the log to log tolevel- the level to log at
-
-
Method Detail
-
flush
public void flush() throws IOException- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
-