Improve System Logs: tag entries by plugin, show currently active plugin - #418
Conversation
…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).
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Duplication | 0 |
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.
|
Warning Review limit reached
Next review available in: 24 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
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:
get_logger()now returns aPluginLoggerAdapterwhen given aplugin_id, so everyself.logger.info/warning/error(...)call in a plugin is automatically stamped withplugin_id. Previously this only happened for calls that explicitly passedextra={'plugin_id': ...}(i.e.log_with_context), so the[Plugin: x]prefix rarely appeared in practice.display_controllernow publishes the currently active display mode/plugin to the shared cache whenever it changes, exposed via a newGET /api/v3/display/current-statusendpoint (same pattern as the existing/api/v3/sync/status).<mode>(plugin:<plugin_id>)" banner, polling the new endpoint every 5s, with a "Filter to this plugin" shortcut.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)PluginLoggerAdapteroutput manually:self.logger.info(...)now renders as... - INFO - plugin.test_plugin - [Plugin: test_plugin] hello worldshort-isojournalctl line: correctly extracts levelINFO, pluginnhl_scoreboard, and a clean message with no duplicate timestamp/logger noiseGenerated by Claude Code