feat(logging): Structured rotating application and Argyll subprocess logs #150

Closed
opened 2026-08-30 12:07:22 +01:00 by gronod · 0 comments
Owner

Description

ICCery currently has no durable logging. Failures surface only via:

  • Browser / WebView console.* (lost when the window closes)
  • Transient process log panels inside individual stages (cleared on navigation)

Support and self-diagnosis require persistent, structured logs of both host activity and every Argyll sidecar’s stdout/stderr.

Scope & Technical Requirements

Backend (Rust)

  • Introduce a logging facade (tracing + tracing-subscriber, or log + fern / env_logger).

  • Log levels: error, warn, info, debug, trace.

    • Default: info in release builds, debug in dev.
  • Write rotating log files under the platform data directory:

    Platform Suggested path
    Windows %APPDATA%/ICCery/logs/
    Linux ~/.local/share/ICCery/logs/
    macOS ~/Library/Application Support/ICCery/logs/
  • Rotation: size-based (e.g. 5–10 MB) and/or daily; keep a small number of retained files (e.g. 5).

  • Prefix every Argyll line with the process id / tool name, e.g.
    [chartread_MyTarget] ROW_COLORS_JSON: ...
    [targen_MyTarget] ...

  • Capture both stdout and stderr streams already handled in ProcessManager.

  • Do not log full user profile paths or other sensitive absolute paths at info or above (truncate or redact where reasonable).

Frontend

  • Settings panel:
    • Log level dropdown (persisted).
    • “Enable verbose process logging” toggle.
    • “Open log folder” / “Copy log path” actions.
  • Optional: mirror critical error events into a non-modal toast so users notice failures without opening DevTools.

Commands

  • get_log_dir() -> String
  • set_log_level(level: String)
  • Persist level via existing settings store.

Acceptance Criteria

  • Host and subprocess output is written to a rotating log file on disk.
  • Log level is configurable from Settings and survives restart.
  • User can open the log folder or copy the current log path from the UI.
  • No sensitive data (full home paths of unrelated files, credentials, etc.) at info+.
  • Logging does not block the UI thread or stall process pipes.
  • Works on Windows, Linux, and macOS.

Dependencies

  • None. Can land independently of Stage 1 / resume work.
  • Complements #147 / process-kill work (logs will show clean shutdown vs orphan).

### Description ICCery currently has no durable logging. Failures surface only via: - Browser / WebView `console.*` (lost when the window closes) - Transient process log panels inside individual stages (cleared on navigation) Support and self-diagnosis require persistent, structured logs of both host activity and every Argyll sidecar’s stdout/stderr. ### Scope & Technical Requirements #### Backend (Rust) - Introduce a logging facade (`tracing` + `tracing-subscriber`, or `log` + `fern` / `env_logger`). - Log levels: `error`, `warn`, `info`, `debug`, `trace`. - Default: `info` in release builds, `debug` in dev. - Write rotating log files under the platform data directory: | Platform | Suggested path | |----------|----------------| | Windows | `%APPDATA%/ICCery/logs/` | | Linux | `~/.local/share/ICCery/logs/` | | macOS | `~/Library/Application Support/ICCery/logs/` | - Rotation: size-based (e.g. 5–10 MB) and/or daily; keep a small number of retained files (e.g. 5). - Prefix every Argyll line with the process id / tool name, e.g. `[chartread_MyTarget] ROW_COLORS_JSON: ...` `[targen_MyTarget] ...` - Capture both stdout and stderr streams already handled in `ProcessManager`. - Do **not** log full user profile paths or other sensitive absolute paths at `info` or above (truncate or redact where reasonable). #### Frontend - Settings panel: - Log level dropdown (persisted). - “Enable verbose process logging” toggle. - “Open log folder” / “Copy log path” actions. - Optional: mirror critical `error` events into a non-modal toast so users notice failures without opening DevTools. #### Commands - `get_log_dir() -> String` - `set_log_level(level: String)` - Persist level via existing settings store. ### Acceptance Criteria - [ ] Host and subprocess output is written to a rotating log file on disk. - [ ] Log level is configurable from Settings and survives restart. - [ ] User can open the log folder or copy the current log path from the UI. - [ ] No sensitive data (full home paths of unrelated files, credentials, etc.) at `info`+. - [ ] Logging does not block the UI thread or stall process pipes. - [ ] Works on Windows, Linux, and macOS. ### Dependencies - None. Can land independently of Stage 1 / resume work. - Complements #147 / process-kill work (logs will show clean shutdown vs orphan). ---
gronod added the Kind/Feature
Reviewed
Confirmed
1
Priority
High
2
labels 2026-08-30 12:07:22 +01:00
gronod added
Reviewed
Duplicate
2
and removed
Reviewed
Confirmed
1
labels 2026-08-30 15:09:41 +01:00
Sign in to join this conversation.