Skip to content

v1.4.0#117

Merged
TiTidom-RC merged 3 commits into
betafrom
dev
Jun 20, 2026
Merged

v1.4.0#117
TiTidom-RC merged 3 commits into
betafrom
dev

Conversation

@TiTidom-RC

Copy link
Copy Markdown
Owner

This pull request introduces a new feature for customizable log filtering in the TV Remote plugin, allowing users to define patterns and target log levels for specific log messages. The implementation includes both backend and frontend components, as well as configuration and persistence of filter rules. The main changes are grouped below:

Log Filters Feature Implementation

  • Added support for user-defined log filters in the daemon: Users can specify patterns to match log messages and assign them a target log level or drop them entirely. This is handled in Python by the new PatternRemapFilter class and integrated into the daemon startup logic. (resources/tvremoted/tvremoted.py [1] [2]; resources/tvremoted/config.py [3] [4]
  • Added PHP methods for managing log filters, including file creation, reading, and saving, with persistence in data/filters/logfilters.json. (core/class/tvremote.class.php core/class/tvremote.class.phpR563-R584)
  • Added a new AJAX action to save log filters from the frontend to the backend. (core/ajax/tvremote.ajax.php core/ajax/tvremote.ajax.phpR68-R77)

User Interface Enhancements

  • Introduced a modal dialog for managing log filters, accessible from the plugin configuration. Users can add, edit, enable/disable, or remove filters via a dedicated UI. (desktop/modal/logfilters.tvremote.php [1]; desktop/js/logfilters.tvremote.js [2]
  • Added a new configuration option in the plugin settings to enable/disable log filters and open the management modal. (plugin_info/configuration.php [1] [2]

Configuration and Persistence

  • Ensured log filters are initialized and persisted across plugin install/update, and that the filters file is created if missing. (plugin_info/install.php [1] [2]
  • Updated .vscode/settings.json and added documentation for the filters directory. (.vscode/settings.json [1]; data/filters/README.md [2]

Miscellaneous

These changes collectively provide a flexible mechanism for users to control log verbosity and filter unwanted log messages based on custom rules, improving the usability and maintainability of the plugin's logging system.

Introduce a log filters feature to allow pattern-based remapping or dropping of daemon log records.

- UI: add a modal (desktop/modal/logfilters.tvremote.php) and JS (desktop/js/logfilters.tvremote.js) to manage filters (enable/disable, pattern, target level). Add a button and checkbox in plugin configuration to open the manager and enable filters.
- Backend PHP: add AJAX handler (saveLogFilters) in core/ajax/tvremote.ajax.php and file helpers in core/class/tvremote.class.php (create/get/save logfilters.json). Install/update now initializes config key and ensures the filters file exists.
- Daemon/Python: extend config to include log filters settings and file path (resources/tvremoted/config.py), add a PatternRemapFilter to remap/drop log records and wire it into logging when enabled (resources/tvremoted/tvremoted.py). Add command-line arg propagation from PHP when starting the daemon.
- Other: bump pluginVersion to 1.4.0, add data/filters/README.md and ignore data/filters/*.json in .gitignore, update .vscode/settings.json.

Notes: logfilters.json is stored in data/filters/ and is gitignored; enabling filters requires restarting the daemon.
Add an info log entry that reports whether log filters are enabled and the number of configured filter rules during daemon startup. This makes it easier to debug and verify the daemon's logging/filter configuration at launch.
Update the success alert in desktop/js/logfilters.tvremote.js (window.initLogFilters) to inform the user that they must restart the daemon for saved log filter changes to take effect. This clarifies required follow-up action after saving filters.
@TiTidom-RC
TiTidom-RC merged commit 4371972 into beta Jun 20, 2026
5 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.

1 participant