java.lang.Object
org.jenkinsci.plugins.vmanager.charts.util.BuildLog

public final class BuildLog extends Object
Build-console output gating utility.

Most of the [vManager Charts] build-console lines (REST URLs, payloads, response statuses, per-session listings, summary printfs, etc.) are only useful when diagnosing an issue. By default the plugin should be quiet: only WARNING / error lines should appear in a job's console output.

This helper exposes a thread-local "verbose" flag that CustomMetricsRunListener sets at the start of each build (from VManagerChartsJobProperty.isVerboseLogging()) and clears in a finally block. Any code reachable from onCompleted can call trace(TaskListener, String) to emit a line that is suppressed when verbose is off.

WARNING and error lines should be printed directly via listener.getLogger().println(...) — they always appear regardless of the verbose flag.

  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Clears the verbose flag for the current thread (call in finally).
    static boolean
    Whether verbose console output is currently enabled.
    static void
    setVerbose(boolean verbose)
    Sets the verbose flag for the current thread.
    static void
    trace(TaskListener listener, String msg)
    Prints msg to the build's console only when the verbose flag is enabled and the listener is non-null.

    Methods inherited from class java.lang.Object

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

    • setVerbose

      public static void setVerbose(boolean verbose)
      Sets the verbose flag for the current thread.
    • clear

      public static void clear()
      Clears the verbose flag for the current thread (call in finally).
    • isVerbose

      public static boolean isVerbose()
      Whether verbose console output is currently enabled.
    • trace

      public static void trace(TaskListener listener, String msg)
      Prints msg to the build's console only when the verbose flag is enabled and the listener is non-null. Use this for chatty diagnostic lines (REST URLs, payloads, per-row summaries, etc.).