Add live, colourised logs to the web UI (#38) #82
No reviewers
Labels
No labels
Bug
BuildIssue
Claude-fixed
Enhancement
In Progress
Low priority
On Hold
Rejected
Security
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
keyop-go/nfq_forwarder!82
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue38_webui_logs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #38.
A fixed-capacity, overwrite-oldest ring buffer in
internal/logcaptures every log record's time/level/message alongside the normal stderr output (wraps the existing tint handler rather than replacing it, so stderr behaviour is completely unaffected). Only allocated whenweb_ui.enabledis true - a newweb_ui.log_buffer_linesconfig field (default 1000) controls the size.GET /logsis a normal session-gated page;GET /api/logs?since=<seq>returns only entries newer than the given cursor. The frontend polls every 2s tracking the highest seq it has rendered, matching this codebase's existing plain-polling convention (no WebSocket/SSE anywhere else here).Colour comes from the frontend mapping each entry's level to a CSS class - not from trying to convert tint's ANSI codes to HTML, which has no stable format to parse. Auto-scrolls to follow new entries unless you've scrolled away from the bottom, with an explicit toggle.
internal/logstays at 100% coverage.make lint/make testboth pass.Looks good, works well. Approving.