Class LogRenderer
java.lang.Object
ai.attackframework.tools.burp.ui.log.LogRenderer
Renderer: writes/replaces lines in the document, formats output, and autoscrolls.
Uses plain text (no per-level styling) so the log can use JTextArea with line wrap.
Threading: expected on the EDT.
-
Constructor Summary
ConstructorsConstructorDescriptionLogRenderer(JTextComponent textComponent) Creates a renderer bound to the provided text component (e.g. -
Method Summary
Modifier and TypeMethodDescriptionvoidappend(String line, LogStore.Level level) Appends a formatted line to the document.voidautoscrollIfNeeded(boolean paused) Scrolls to the bottom unless paused.voidclear()Clears all rendered content and resets internal cursor state.formatLine(LocalDateTime ts, LogStore.Level lvl, String msg, int repeats) Formats a log entry into a single rendered line.voidreplaceLast(String line, LogStore.Level level) Replaces the most recently written line, preserving cursor bookkeeping.
-
Constructor Details
-
LogRenderer
Creates a renderer bound to the provided text component (e.g. JTextArea for line wrap).Caller must construct on the EDT.
- Parameters:
textComponent- target component to render into (must have an AbstractDocument)
-
-
Method Details
-
clear
public void clear()Clears all rendered content and resets internal cursor state.EDT only.
-
append
Appends a formatted line to the document.- Parameters:
line- text to append (should include trailing newline)level- log level (unused; kept for API compatibility)
-
replaceLast
Replaces the most recently written line, preserving cursor bookkeeping.- Parameters:
line- replacement text (should include trailing newline)level- log level (unused; kept for API compatibility)
-
autoscrollIfNeeded
public void autoscrollIfNeeded(boolean paused) Scrolls to the bottom unless paused. -
formatLine
Formats a log entry into a single rendered line.- Parameters:
ts- timestamp (fallbacks to now when null)lvl- log levelmsg- log message (nullable)repeats- duplicate count;>1renders as(xN)- Returns:
- formatted line including trailing newline
-