Class Logger
java.lang.Object
ai.attackframework.tools.burp.utils.Logger
- 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 ClassesModifier and TypeClassDescriptionstatic interfaceListener contract used by LogPanel and tests.static interfaceMarker for listeners that should receive a replay of recent messages when registered (e.g.static final classLogback appender that forwards non-internal events to the UI listener bus. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidemitToListeners(String level, String message) Allows logging backends to forward events into the UI listener bus.static voidinitialize(burp.api.montoya.logging.Logging montoyaLogging) Wires Burp's Logging sink.static voidinternalDebug(String msg) Logs at DEBUG without notifying UI listeners.static voidinternalInfo(String msg) Logs at INFO without notifying UI listeners.static voidinternalTrace(String msg) Logs at TRACE without notifying UI listeners.static voidinternalWarn(String msg) Logs at WARN without notifying UI listeners.static voidLogs at DEBUG (when enabled) and mirrors to UI listeners only (not Burp console).static voidLogs at ERROR and mirrors to Burp and UI listeners.static voidLogs at ERROR with throwable, mirrors concise summary to Burp/UI listeners.static voidlogErrorPanelOnly(String msg) Logs at ERROR to SLF4J and UI listeners only; does not send to Burp's error console.static voidLogs at INFO and mirrors to Burp and UI listeners.static voidlogInfoPanelOnly(String msg) Logs at INFO to SLF4J and UI listeners only; does not send to Burp extension Output.static voidLogs at TRACE (when enabled) and mirrors to UI listeners only (not Burp console).static voidLogs at WARN and mirrors to Burp and UI listeners.static voidregisterListener(Logger.LogListener listener) Registers a UI/log listener.static voidClears listener registrations, replay state, and the Montoya logging sink.static voidunregisterListener(Logger.LogListener listener) Unregisters a UI/log listener.
-
Method Details
-
initialize
public static void initialize(burp.api.montoya.logging.Logging montoyaLogging) Wires Burp's Logging sink.- Parameters:
montoyaLogging- Burp logging handle
-
registerListener
Registers a UI/log listener. If the listener is aLogger.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
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
Logs at INFO and mirrors to Burp and UI listeners.- Parameters:
msg- message to log
-
logInfoPanelOnly
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
Logs at ERROR to SLF4J and UI listeners only; does not send to Burp's error console.- Parameters:
msg- message to log
-
logWarn
Logs at WARN and mirrors to Burp and UI listeners.- Parameters:
msg- message to log
-
logDebug
Logs at DEBUG (when enabled) and mirrors to UI listeners only (not Burp console).- Parameters:
msg- message to log
-
logTrace
Logs at TRACE (when enabled) and mirrors to UI listeners only (not Burp console).- Parameters:
msg- message to log
-
logError
Logs at ERROR and mirrors to Burp and UI listeners.- Parameters:
msg- message to log
-
logError
Logs at ERROR with throwable, mirrors concise summary to Burp/UI listeners.- Parameters:
msg- message to logt- throwable (nullable)
-
emitToListeners
Allows logging backends to forward events into the UI listener bus.- Parameters:
level- level stringmessage- message to emit
-
internalInfo
Logs at INFO without notifying UI listeners. -
internalWarn
Logs at WARN without notifying UI listeners. -
internalDebug
Logs at DEBUG without notifying UI listeners. -
internalTrace
Logs at TRACE without notifying UI listeners.
-