Class LoggerOutputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable

    public class LoggerOutputStream
    extends java.io.OutputStream
    OutputStream implementation for outputting data to a Logger. Expects that each appended byte represents a char (1:1, so only ASCII/LATIN-1 and similar charsets are supported). flush() events are ignored - we end() log entries on newlines.
    • Constructor Summary

      Constructors 
      Constructor Description
      LoggerOutputStream​(Logger logger, LogLevel logLevel)
      Create a stream that writes bytes as chars to the specified logger at the specified level.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void write​(int b)  
      • Methods inherited from class java.io.OutputStream

        close, flush, nullOutputStream, write, write
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LoggerOutputStream

        public LoggerOutputStream​(Logger logger,
                                  LogLevel logLevel)
        Create a stream that writes bytes as chars to the specified logger at the specified level.
        Parameters:
        logger -
        logLevel -
    • Method Detail

      • write

        public void write​(int b)
                   throws java.io.IOException
        Specified by:
        write in class java.io.OutputStream
        Throws:
        java.io.IOException