org.springframework.shell.support.logging
Class LoggingOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by 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

Field Summary
protected static Logger LOGGER
           
 
Constructor Summary
LoggingOutputStream(Level level)
          Constructor
 
Method Summary
 void close()
           
 void flush()
           
 String getSourceClassName()
           
 void setSourceClassName(String sourceClassName)
           
 void write(int b)
           
 
Methods inherited from class java.io.OutputStream
write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

protected static final Logger LOGGER
Constructor Detail

LoggingOutputStream

public LoggingOutputStream(Level level)
Constructor

Parameters:
level - the level at which to log (required)
Method Detail

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)