org.springframework.shell.support.logging

## Class LoggingOutputStream

- java.lang.Object
- - java.io.OutputStream
  - - org.springframework.shell.support.logging.LoggingOutputStream

- All Implemented Interfaces:
    Closeable, Flushable, AutoCloseable

      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

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static Logger` | `LOGGER`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LoggingOutputStream(Level level)` Constructor

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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`
      Specified by:
        `close` in interface `AutoCloseable`
      Overrides:
        `close` in class `OutputStream`
      Throws:
        `IOException`

    - #### getSourceClassName

          public String getSourceClassName()

    - #### setSourceClassName

          public void setSourceClassName(String sourceClassName)