Class LineLoggingBuffer

java.lang.Object
com.icegreen.greenmail.util.LineLoggingBuffer

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

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

    Fields
    Modifier and Type
    Field
    Description
    protected final org.slf4j.Logger
     
    protected static final byte[]
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates new buffer using given line prefix.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    append(int b)
    Appends and escapes value.
    protected boolean
     
    void
    Triggers log output of current buffer (if any) and resets back to empty buffer.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • log

      protected final org.slf4j.Logger log
    • WRAP

      protected static final byte[] WRAP
  • Constructor Details

    • LineLoggingBuffer

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

    • 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()