|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.OutputStream
java.io.ByteArrayOutputStream
eu.larkc.core.data.util.LoggingOutputStream
public class LoggingOutputStream
An OutputStream that stores each line after a flush(). The stored contents is then written to a Logger by calling one of the printLogAs* methods. The logging messages can not be logged immediately because it is likely that the System.out (stdout) stream is redirected and can thus not be used by the logger (Class derived from here with the permission of the author).
Constructor Summary | |
---|---|
LoggingOutputStream(org.slf4j.Logger logger)
Constructor |
Method Summary | |
---|---|
void |
flush()
upon flush() write the existing contents of the OutputStream to the logger as a log record. |
void |
printLogAsDebug()
Prints the saved log messages as debug messages. |
void |
printLogAsError()
Prints the saved log messages as error messages. |
void |
printLogAsInfo()
Prints the saved log messages as info messages. |
void |
printLogAsTrace()
Prints the saved log messages as trace messages. |
void |
printLogAsWarn()
Prints the saved log messages as warning messages. |
Methods inherited from class java.io.ByteArrayOutputStream |
---|
close, reset, size, toByteArray, toString, toString, toString, write, write, writeTo |
Methods inherited from class java.io.OutputStream |
---|
write |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LoggingOutputStream(org.slf4j.Logger logger)
logger
- Logger to write toMethod Detail |
---|
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException
- in case of errorpublic void printLogAsDebug()
public void printLogAsInfo()
public void printLogAsWarn()
public void printLogAsError()
public void printLogAsTrace()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |