Class LineLoggingBuffer


  • public class LineLoggingBuffer
    extends Object
    Buffers and logs when detecting CR-LF.

    • Wraps long lines
    • Escapes non-ASCII-printable chars
    • Field Detail

      • log

        protected final org.slf4j.Logger log
      • WRAP

        protected static final byte[] WRAP
    • Constructor Detail

      • LineLoggingBuffer

        public LineLoggingBuffer​(String linePrefix)
        Creates new buffer using given line prefix.
        Parameters:
        linePrefix - prefix for each line printed, eg "S:" or "C:"
    • Method Detail

      • append

        public void append​(int b)
        Appends and escapes value.
        Parameters:
        b - value
      • logLine

        public void logLine()
        Triggers log output of current buffer (if any) and resets back to empty buffer.
      • isLineLengthExceeded

        protected boolean isLineLengthExceeded()