Class Logger

java.lang.Object
ai.attackframework.tools.burp.utils.Logger

public final class Logger extends Object
- Delegates to SLF4J so levels/appenders are configurable. - Mirrors to Burp's Logging when available. - Exposes a listener bus consumed by LogPanel and tests. - Keeps a bounded replay buffer so newly registered listeners (e.g. after tab switch) receive recent messages and the Log panel shows full history. - Contains a Logback appender (nested class) that forwards non-internal SLF4J events to the listener bus.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
    Listener contract used by LogPanel and tests.
    static interface 
    Marker for listeners that should receive a replay of recent messages when registered (e.g.
    static final class 
    Logback appender that forwards non-internal events to the UI listener bus.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    emitToListeners(String level, String message)
    Allows logging backends to forward events into the UI listener bus.
    static void
    initialize(burp.api.montoya.logging.Logging montoyaLogging)
    Wires Burp's Logging sink.
    static void
    Logs at DEBUG without notifying UI listeners.
    static void
    Logs at INFO without notifying UI listeners.
    static void
    Logs at TRACE without notifying UI listeners.
    static void
    Logs at WARN without notifying UI listeners.
    static void
    Logs at DEBUG (when enabled) and mirrors to UI listeners only (not Burp console).
    static void
    Logs at ERROR and mirrors to Burp and UI listeners.
    static void
    Logs at ERROR with throwable, mirrors concise summary to Burp/UI listeners.
    static void
    Logs at ERROR to SLF4J and UI listeners only; does not send to Burp's error console.
    static void
    Logs at INFO and mirrors to Burp and UI listeners.
    static void
    Logs at INFO to SLF4J and UI listeners only; does not send to Burp extension Output.
    static void
    Logs at TRACE (when enabled) and mirrors to UI listeners only (not Burp console).
    static void
    Logs at WARN and mirrors to Burp and UI listeners.
    static void
    Registers a UI/log listener.
    static void
    Clears listener registrations, replay state, and the Montoya logging sink.
    static void
    Unregisters a UI/log listener.

    Methods inherited from class java.lang.Object

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

    • initialize

      public static void initialize(burp.api.montoya.logging.Logging montoyaLogging)
      Wires Burp's Logging sink.

      Parameters:
      montoyaLogging - Burp logging handle
    • registerListener

      public static void registerListener(Logger.LogListener listener)
      Registers a UI/log listener. If the listener is a Logger.ReplayableLogListener, recent buffered messages are replayed so the panel shows full history (e.g. after switching back to the extension tab when Burp had removed the panel).
      Parameters:
      listener - listener to add (nullable ignored)
    • unregisterListener

      public static void unregisterListener(Logger.LogListener listener)
      Unregisters a UI/log listener.
      Parameters:
      listener - listener to remove (nullable ignored)
    • resetState

      public static void resetState()
      Clears listener registrations, replay state, and the Montoya logging sink.

      Intended for extension unload and test isolation so stale listeners do not survive a reload or leak state across tests.

    • logInfo

      public static void logInfo(String msg)
      Logs at INFO and mirrors to Burp and UI listeners.

      Parameters:
      msg - message to log
    • logInfoPanelOnly

      public static void logInfoPanelOnly(String msg)
      Logs at INFO to SLF4J and UI listeners only; does not send to Burp extension Output. Use for high-signal messages that should appear in the extension's Log tab but not in Burp's Extensions → Output console (e.g. "Creating index for: X", "Result for X: CREATED").
      Parameters:
      msg - message to log
    • logErrorPanelOnly

      public static void logErrorPanelOnly(String msg)
      Logs at ERROR to SLF4J and UI listeners only; does not send to Burp's error console.
      Parameters:
      msg - message to log
    • logWarn

      public static void logWarn(String msg)
      Logs at WARN and mirrors to Burp and UI listeners.

      Parameters:
      msg - message to log
    • logDebug

      public static void logDebug(String msg)
      Logs at DEBUG (when enabled) and mirrors to UI listeners only (not Burp console).

      Parameters:
      msg - message to log
    • logTrace

      public static void logTrace(String msg)
      Logs at TRACE (when enabled) and mirrors to UI listeners only (not Burp console).

      Parameters:
      msg - message to log
    • logError

      public static void logError(String msg)
      Logs at ERROR and mirrors to Burp and UI listeners.

      Parameters:
      msg - message to log
    • logError

      public static void logError(String msg, Throwable t)
      Logs at ERROR with throwable, mirrors concise summary to Burp/UI listeners.

      Parameters:
      msg - message to log
      t - throwable (nullable)
    • emitToListeners

      public static void emitToListeners(String level, String message)
      Allows logging backends to forward events into the UI listener bus.

      Parameters:
      level - level string
      message - message to emit
    • internalInfo

      public static void internalInfo(String msg)
      Logs at INFO without notifying UI listeners.
    • internalWarn

      public static void internalWarn(String msg)
      Logs at WARN without notifying UI listeners.
    • internalDebug

      public static void internalDebug(String msg)
      Logs at DEBUG without notifying UI listeners.
    • internalTrace

      public static void internalTrace(String msg)
      Logs at TRACE without notifying UI listeners.