Class LoggerReader

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

    public class LoggerReader
    extends java.io.FilterReader
    Logs each line read to a pre-defined level. Can also be configured with a Marker.
    Since:
    2.1
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.String FQCN  
      private InternalReader reader  
      • Fields inherited from class java.io.FilterReader

        in
      • Fields inherited from class java.io.Reader

        lock
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected LoggerReader​(java.io.Reader reader, ExtendedLogger logger, java.lang.String fqcn, Level level, Marker marker)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      int read()  
      int read​(char[] cbuf)  
      int read​(char[] cbuf, int off, int len)  
      int read​(java.nio.CharBuffer target)  
      java.lang.String toString()  
      • Methods inherited from class java.io.FilterReader

        mark, markSupported, ready, reset, skip
      • Methods inherited from class java.io.Reader

        nullReader, transferTo
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • FQCN

        private static final java.lang.String FQCN
    • Constructor Detail

      • LoggerReader

        protected LoggerReader​(java.io.Reader reader,
                               ExtendedLogger logger,
                               java.lang.String fqcn,
                               Level level,
                               Marker marker)
    • Method Detail

      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.FilterReader
        Throws:
        java.io.IOException
      • read

        public int read()
                 throws java.io.IOException
        Overrides:
        read in class java.io.FilterReader
        Throws:
        java.io.IOException
      • read

        public int read​(char[] cbuf)
                 throws java.io.IOException
        Overrides:
        read in class java.io.Reader
        Throws:
        java.io.IOException
      • read

        public int read​(char[] cbuf,
                        int off,
                        int len)
                 throws java.io.IOException
        Overrides:
        read in class java.io.FilterReader
        Throws:
        java.io.IOException
      • read

        public int read​(java.nio.CharBuffer target)
                 throws java.io.IOException
        Specified by:
        read in interface java.lang.Readable
        Overrides:
        read in class java.io.Reader
        Throws:
        java.io.IOException
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object