Home

dev / openkara

publicthedavidweng/OpenKara· sync paused
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

feat(observability): file logging, cross-platform About, and useful debug export (#231)

2 months ago

687da3a
Authored
Davy7/26/2026, 2:49:02 AM
Close the 1.0 observability gap so a user bug report carries actionable
information.

File logging
- Install a tracing-subscriber that writes a daily-rolling file (7-day
  retention) under Tauri's appLogDir() and mirrors to stderr. Chosen over a
  log-facade plugin because the crate already depends on tracing and ORT emits
  its diagnostics through tracing, so both are captured with no new capability
  surface. Default level info (overridable via OPENKARA_LOG); errors always
  recorded. Blocking writes so a crash still leaves the last lines on disk.
- Migrate the diagnostic eprintln! calls in app_runtime, separator::model, and
  cache::stems to tracing macros (stderr output preserved via the stderr layer).

Version visibility + debug export (all platforms)
- New get_debug_info command assembles one DebugInfo snapshot: app version,
  build SHA, OS/arch, catalog generation + release id, model status/version,
  runtime state + artifact id, execution provider, and the log-file path.
- New Settings -> About section renders it and offers "Copy debug info". The
  macOS Help menu's "Copy Debug Info" now shares the exact same data path and
  plain-text format (src/lib/debug-info.ts) — one implementation, two surfaces.
- Remove the dead non-macOS About branch in app_menu (the menu mounts on macOS
  only); About/version now lives in Settings cross-platform.

Docs + i18n
- README, README_CN, and the EN/zh FAQ gain a "reporting a bug" section with the
  per-platform log paths and the Settings -> About -> Copy debug info flow.
- settings.about.* keys added to en and zh-CN (structural i18n guard passes).

Deps + packaging
- Add tracing-subscriber + tracing-appender (MIT; pass cargo-deny). Regenerate
  packaging/flatpak/generated/cargo-sources.json for the new transitive crates.

Tests: Rust debug-info assembly + serialization + log-path helper; TS formatter,
copy helper, About component, menu copy-debug-info branch, IPC wrapper, and an
About i18n completeness guard.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

Parent7a1d9df

28 files changed
  • README.md+28−0
  • README_CN.md+19−0
  • packaging/flatpak/generated/cargo-sources.json+117−0
  • src-tauri/Cargo.lock+93−0
  • src-tauri/Cargo.toml+2−0
  • src-tauri/src/app_menu.rs+4−4
  • src-tauri/src/app_runtime.rs+86−63
  • src-tauri/src/cache/stems.rs+2−2
  • src-tauri/src/commands/diagnostics.rs+328−0
  • src-tauri/src/commands/mod.rs+1−0
  • src-tauri/src/lib.rs+2−0
  • src-tauri/src/logging.rs+104−0
  • src-tauri/src/separator/model.rs+11−11
  • src/components/Settings/SettingsAboutSection.test.tsx+147−0
  • src/components/Settings/SettingsAboutSection.tsx+109−0
  • src/components/Settings/SettingsOverlay.tsx+2−0
  • src/lib/debug-info.test.ts+97−0
  • src/lib/debug-info.ts+47−0
  • src/lib/tauri/settings.ts+5−0
  • src/lib/tauri/tauri-wrappers.test.ts+8−0
  • src/locales/en.json+15−0
  • src/locales/locales.test.ts+31−0
  • src/locales/zh-CN.json+15−0
  • src/runtime/menu-runtime.test.ts+48−3
  • src/runtime/menu-runtime.ts+9−9
  • src/types/ipc.ts+26−0
  • website/faq.md+12−0
  • website/zh/faq.md+12−0