Package com.icegreen.greenmail.util
Class LoggingOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- com.icegreen.greenmail.util.LoggingOutputStream
-
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
public class LoggingOutputStream extends FilterOutputStream
Logs stream for debugging purpose on DEBUG level.
-
-
Field Summary
Fields Modifier and Type Field Description protected LineLoggingBuffer
loggingBuffer
-
Fields inherited from class java.io.FilterOutputStream
out
-
-
Constructor Summary
Constructors Constructor Description LoggingOutputStream(OutputStream out, String prefix)
Creates an output stream filter built on top of the specified underlying output stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
flush()
void
write(int b)
-
Methods inherited from class java.io.FilterOutputStream
write, write
-
Methods inherited from class java.io.OutputStream
nullOutputStream
-
-
-
-
Field Detail
-
loggingBuffer
protected final LineLoggingBuffer loggingBuffer
-
-
Constructor Detail
-
LoggingOutputStream
public LoggingOutputStream(OutputStream out, String prefix)
Creates an output stream filter built on top of the specified underlying output stream.- Parameters:
out
- the underlying output stream to be assigned to the fieldFilterOutputStream.out
for later use, ornull
if this instance is to be created without an underlying stream.prefix
- a log message prefix, eg 's: ' for server side protocol trace output.
-
-
Method Detail
-
write
public void write(int b) throws IOException
- Overrides:
write
in classFilterOutputStream
- Throws:
IOException
-
flush
public void flush() throws IOException
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classFilterOutputStream
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classFilterOutputStream
- Throws:
IOException
-
-