Class RecursiveBlockingVerbose.Tracer

java.lang.Object
edu.cmu.tetrad.search.RecursiveBlockingVerbose.Tracer
Enclosing class:
RecursiveBlockingVerbose

public static final class RecursiveBlockingVerbose.Tracer extends Object
Lightweight indented tracer. No-ops if disabled.
  • Method Details

    • enabled

      public static RecursiveBlockingVerbose.Tracer enabled(PrintStream out)
      Creates an enabled tracer instance. An enabled tracer will actively log messages and perform logging-related operations.
      Parameters:
      out - the PrintStream to which log messages will be written
      Returns:
      a new instance of an enabled Tracer configured to output to the specified PrintStream
    • disabled

      public static RecursiveBlockingVerbose.Tracer disabled()
      Creates a disabled tracer instance. A disabled tracer does not log any messages or perform any logging-related operations.
      Returns:
      a new instance of a disabled Tracer
    • header

      public void header(String title)
      Logs a section header with optional key-value pairs.
      Parameters:
      title - the section title
    • section

      public void section(String name, String... kv)
      Logs a section header with optional key-value pairs.
      Parameters:
      name - the section name
      kv - optional key-value pairs to include in the section header
    • push

      public void push(String msg)
      Logs a message if the tracer is enabled.
      Parameters:
      msg - the message to log
    • pop

      public void pop(String trailer)
      Decreases the indentation level and optionally logs a closing trailer message if the tracer is enabled.
      Parameters:
      trailer - the closing message to log, or null/empty to skip logging the trailer
    • log

      public void log(String msg)
      Logs a message if the tracer is enabled.
      Parameters:
      msg - the message to log
    • ok

      public void ok(String msg)
      Logs a success message prefixed with a checkmark symbol if the tracer is enabled.
      Parameters:
      msg - the success message to log
    • fail

      public void fail(String msg)
      Logs a failure message prefixed with a cross mark emoji if the tracer is enabled.
      Parameters:
      msg - the failure message to log
    • warn

      public void warn(String msg)
      Logs a warning message if the tracer is enabled.
      Parameters:
      msg - the warning message to log
    • success

      public void success(String msg)
      Logs a success message prefixed with a checkmark emoji if the tracer is enabled.
      Parameters:
      msg - the success message to log