feat: Logging #139

Closed
opened 2026-08-29 17:26:13 +01:00 by gronod · 0 comments
Owner

Description

Add structured, configurable logging for the host application, frontend, and all ArgyllCMS subprocesses so that users and support can diagnose failures without enabling developer tools.

Scope & Technical Requirements

1. Backend (Rust / Tauri)

  • Log Management Plugin: Integrate the official tauri-plugin-log (and log crate) to handle file rotation, log levels, and automatic bridging of frontend console logs to the backend.
  • Log Location: Use Tauri's native app_log_dir() to ensure logs are written to the correct platform-specific directory (e.g., %APPDATA%\ICCery\logs on Windows, ~/.local/share/ICCery/logs or ~/.config/ICCery/logs on Linux/macOS).
  • Subprocess Logging: Capture stdout and stderr of every spawned Argyll process (targen, printtarg, chartread, colprof, profcheck, iccgamut, instlist, average) and pipe them to the log file with a clear prefix (e.g., [chartread] ...).
  • Log Levels: Support error, warn, info, debug, trace (default to info in release builds, debug in development).

2. Frontend (HTML / JS)

  • Settings UI: Add a "Diagnostics" or "Logging" section in the Settings panel containing:
    • A dropdown to select the global log level.
    • A toggle for "Enable verbose process logging" (if separate from the global log level).
    • A button to "Open Log Folder" (using Tauri's open API) and "Copy Log Path".
  • Error Surfacing: Ensure critical errors that currently only appear in the developer console are forwarded to the logger (handled automatically if tauri-plugin-log is configured to forward console messages) and surfaced in the UI via toasts or alerts where appropriate.

Acceptance Criteria

  • tauri-plugin-log is integrated and successfully writes rotating log files to the standard OS log directory.
  • Frontend console.log/error messages are captured in the unified log file.
  • ArgyllCMS subprocess stdout/stderr streams are captured in the log file with identifiable prefixes.
  • The Settings panel allows configuring the log level, which persists across app restarts.
  • A user can click "Open Log Folder" in the Settings UI to reveal the log files in their native file explorer.
  • No sensitive data (e.g., full paths of user profiles) is logged at info level or above.

Dependencies & Ordering

  • Milestone: Milestone 10 (v0.5.0)
  • Ordering: Step 1
  • Dependencies: None
### Description Add structured, configurable logging for the host application, frontend, and all ArgyllCMS subprocesses so that users and support can diagnose failures without enabling developer tools. ### Scope & Technical Requirements #### 1. Backend (Rust / Tauri) - **Log Management Plugin**: Integrate the official `tauri-plugin-log` (and `log` crate) to handle file rotation, log levels, and automatic bridging of frontend console logs to the backend. - **Log Location**: Use Tauri's native `app_log_dir()` to ensure logs are written to the correct platform-specific directory (e.g., `%APPDATA%\ICCery\logs` on Windows, `~/.local/share/ICCery/logs` or `~/.config/ICCery/logs` on Linux/macOS). - **Subprocess Logging**: Capture `stdout` and `stderr` of every spawned Argyll process (`targen`, `printtarg`, `chartread`, `colprof`, `profcheck`, `iccgamut`, `instlist`, `average`) and pipe them to the log file with a clear prefix (e.g., `[chartread] ...`). - **Log Levels**: Support `error`, `warn`, `info`, `debug`, `trace` (default to `info` in release builds, `debug` in development). #### 2. Frontend (HTML / JS) - **Settings UI**: Add a "Diagnostics" or "Logging" section in the Settings panel containing: - A dropdown to select the global log level. - A toggle for "Enable verbose process logging" (if separate from the global log level). - A button to "Open Log Folder" (using Tauri's `open` API) and "Copy Log Path". - **Error Surfacing**: Ensure critical errors that currently only appear in the developer console are forwarded to the logger (handled automatically if `tauri-plugin-log` is configured to forward console messages) and surfaced in the UI via toasts or alerts where appropriate. ### Acceptance Criteria - [ ] `tauri-plugin-log` is integrated and successfully writes rotating log files to the standard OS log directory. - [ ] Frontend `console.log/error` messages are captured in the unified log file. - [ ] ArgyllCMS subprocess stdout/stderr streams are captured in the log file with identifiable prefixes. - [ ] The Settings panel allows configuring the log level, which persists across app restarts. - [ ] A user can click "Open Log Folder" in the Settings UI to reveal the log files in their native file explorer. - [ ] No sensitive data (e.g., full paths of user profiles) is logged at `info` level or above. ### Dependencies & Ordering - **Milestone**: Milestone 10 (`v0.5.0`) - **Ordering**: Step 1 - **Dependencies**: None
gronod added this to the Milestone 10: Production Ready Features (v0.6.0) milestone 2026-08-29 17:26:13 +01:00
gronod added the Kind/Feature
Reviewed
Confirmed
1
labels 2026-08-29 17:26:13 +01:00
Sign in to join this conversation.