java.lang.Object
io.jenkins.plugins.changeinvestigator.evidence.LogReducer

public final class LogReducer extends Object
Reduces a (potentially huge) console log down to a small, bounded set of lines that are likely relevant to diagnosing a build failure, without ever sending the entire log anywhere. Secrets are redacted before any line leaves this class.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Hard cap on how many lines of the raw log this reducer will ever read, regardless of config.
  • Method Summary

    Modifier and Type
    Method
    Description
    reduce(BufferedReader reader, int maxChars)
    Reads from reader, extracts likely-relevant lines (or the tail of the log if nothing matches), redacts secrets, cleans ANSI/control noise, and bounds the total output to maxChars characters.

    Methods inherited from class java.lang.Object

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

    • MAX_LINES_SCANNED

      public static final int MAX_LINES_SCANNED
      Hard cap on how many lines of the raw log this reducer will ever read, regardless of config.
      See Also:
  • Method Details

    • reduce

      public static LogReducer.Result reduce(BufferedReader reader, int maxChars) throws IOException
      Reads from reader, extracts likely-relevant lines (or the tail of the log if nothing matches), redacts secrets, cleans ANSI/control noise, and bounds the total output to maxChars characters.
      Throws:
      IOException