org.springframework.shell.support.logging
Class LoggingOutputStream
java.lang.Object
java.io.OutputStream
org.springframework.shell.support.logging.LoggingOutputStream
- All Implemented Interfaces:
- Closeable, Flushable
public class LoggingOutputStream
- extends OutputStream
Wraps an OutputStream
and automatically passes each line to the Logger
when OutputStream.flush()
or OutputStream.close()
is called.
- Since:
- 1.1
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOGGER
protected static final Logger LOGGER
LoggingOutputStream
public LoggingOutputStream(Level level)
- Constructor
- Parameters:
level
- the level at which to log (required)
write
public void write(int b)
throws IOException
- Specified by:
write
in class OutputStream
- Throws:
IOException
flush
public void flush()
throws IOException
- Specified by:
flush
in interface Flushable
- Overrides:
flush
in class OutputStream
- Throws:
IOException
close
public void close()
throws IOException
- Specified by:
close
in interface Closeable
- Overrides:
close
in class OutputStream
- Throws:
IOException
getSourceClassName
public String getSourceClassName()
setSourceClassName
public void setSourceClassName(String sourceClassName)