Skip to content

Improve System Logs: tag entries by plugin, show currently active plugin - #418

Merged
ChuckBuilds merged 1 commit into
mainfrom
claude/system-logs-improvements-glapcd
Jul 18, 2026
Merged

Improve System Logs: tag entries by plugin, show currently active plugin#418
ChuckBuilds merged 1 commit into
mainfrom
claude/system-logs-improvements-glapcd

Conversation

@ChuckBuilds

Copy link
Copy Markdown
Owner

Summary

Two related improvements to System Logs so it's easier to tell which plugin a log line came from and which plugin is currently intended to be on-screen:

  • Structural plugin tagging: get_logger() now returns a PluginLoggerAdapter when given a plugin_id, so every self.logger.info/warning/error(...) call in a plugin is automatically stamped with plugin_id. Previously this only happened for calls that explicitly passed extra={'plugin_id': ...} (i.e. log_with_context), so the [Plugin: x] prefix rarely appeared in practice.
  • Active-plugin visibility: display_controller now publishes the currently active display mode/plugin to the shared cache whenever it changes, exposed via a new GET /api/v3/display/current-status endpoint (same pattern as the existing /api/v3/sync/status).
  • System Logs UI:
    • New "Now showing: <mode> (plugin: <plugin_id>)" banner, polling the new endpoint every 5s, with a "Filter to this plugin" shortcut.
    • New Plugin filter dropdown, populated dynamically from plugin tags seen in the loaded logs, alongside the existing level filter and search.
    • Each log row now shows a plugin badge when the line came from a plugin logger.
    • Fixed log-line parsing: the backend requests journalctl --output=short-iso (ISO-8601 timestamps), but the frontend's timestamp regex only matched the older syslog format ("Oct 13 14:23:45"). That meant level detection and the plugin-tag extraction never actually ran against real log output — the parser now handles both formats and correctly strips the app's own duplicate timestamp/level/logger-name prefix before pulling out the plugin tag.

Test plan

  • python3 -m pytest test/test_display_controller.py test/test_display_controller_vegas_tick.py test/test_display_controller_optimizations.py test/test_display_controller_plugin_toggle.py test/test_plugin_system.py test/plugins/test_plugin_base.py — 79 passed, 1 skipped (pre-existing skip, unrelated)
  • Verified PluginLoggerAdapter output manually: self.logger.info(...) now renders as ... - INFO - plugin.test_plugin - [Plugin: test_plugin] hello world
  • Verified the new JS log-line parser against a simulated short-iso journalctl line: correctly extracts level INFO, plugin nhl_scoreboard, and a clean message with no duplicate timestamp/logger noise
  • Manual UI check on a live Pi (banner polling, plugin filter dropdown, badges) — not exercised in this sandboxed environment

Generated by Claude Code

…Logs

- get_logger() now returns a PluginLoggerAdapter when given a plugin_id,
  so every plugin log call is stamped with plugin_id automatically instead
  of only calls that explicitly passed extra={'plugin_id': ...}. This makes
  the "[Plugin: x]" prefix reliable in the journalctl-backed log stream.
- display_controller publishes the currently active mode/plugin to the
  shared cache whenever it changes, exposed via a new
  GET /api/v3/display/current-status endpoint.
- System Logs page: adds a "Now showing" banner backed by that endpoint, a
  plugin filter dropdown (populated from parsed log lines), a plugin badge
  per log entry, and fixes log parsing to handle the short-iso timestamp
  format journalctl actually returns (the old regex only matched syslog
  timestamps, so level/plugin extraction silently never ran).
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 duplication

Metric Results
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@ChuckBuilds, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 24 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 22d54369-45ef-4a37-8e3e-ee908cfdf9b7

📥 Commits

Reviewing files that changed from the base of the PR and between 66f9950 and 8a08544.

📒 Files selected for processing (5)
  • src/display_controller.py
  • src/logging_config.py
  • src/plugin_system/base_plugin.py
  • web_interface/blueprints/api_v3.py
  • web_interface/templates/v3/partials/logs.html
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/system-logs-improvements-glapcd

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ChuckBuilds
ChuckBuilds merged commit 6a9d801 into main Jul 18, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants