Skip to content

feat(windows): add configurable application logging - #168

Merged
1lck merged 2 commits into
1lck:preview/0.3.0from
yangboxuan726:codex/issue-133-windows-logging
Aug 19, 2026
Merged

feat(windows): add configurable application logging#168
1lck merged 2 commits into
1lck:preview/0.3.0from
yangboxuan726:codex/issue-133-windows-logging

Conversation

@yangboxuan726

Copy link
Copy Markdown
Contributor

Summary

  • add a dedicated Windows Logs settings page with default, configured, and effective paths
  • persist a machine-local custom log root and switch the active writer immediately without restarting
  • add structured INFO/DEBUG logging, console and unhandled-error capture, FPS diagnostics, redaction, panic sidecars, retention, rotation, and runtime fallback
  • support opening the current log, opening its directory through a host-owned command, copying the path, clearing logs, and refreshing open log buffers after clear or directory changes

Why

Windows previously sent frontend traces and startup milestones mainly to stderr, while the existing read_lithe_log UI entry had no working host command. Users could not reliably locate or retain diagnostic evidence for freezes, crashes, or intermittent feature failures.

This PR delivers the Windows side of #133 without changing macOS or shared Rust Core contracts.

Behavior

  • default production level is INFO; session-only diagnostic mode enables DEBUG and a 10-second FPS heartbeat
  • logs rotate at 10 MB, keep the newest five regular files per day, and remove files older than 30 days on startup
  • custom locations write to <selected parent>/Lithe/logs; configuration remains sticky when a directory is unavailable
  • runtime write failures fall back to the default directory, retain the custom configuration, retry the current line, and notify the UI
  • sensitive headers, common token shapes, user paths, workspace paths, and UNC paths are redacted before persistence
  • clearing or switching directories updates any open read-only log tab immediately

Validation

  • ./scripts/build-windows.ps1 -Configuration Release
  • cargo test --manifest-path windows/tauri/src-tauri/Cargo.toml — 62 passed
  • bun run typecheck
  • targeted frontend logging/FPS/localization tests — 11 passed
  • bun run lint — no new warnings
  • ./scripts/verify-windows-boundaries.ps1
  • native Windows manual QA for default/custom paths, open directory, clear/refresh, restore/delete, session diagnostics, and modal behavior
  • git diff --check

Screenshot

Windows Logs settings

@1lck

1lck commented Aug 19, 2026

Copy link
Copy Markdown
Owner

Draft改一下

@yangboxuan726
yangboxuan726 marked this pull request as ready for review August 19, 2026 02:04
@yangboxuan726
yangboxuan726 requested a review from 1lck as a code owner August 19, 2026 02:04
@yangboxuan726

Copy link
Copy Markdown
Contributor Author

已调整为 Ready for review,感谢提醒。Windows 端已完成手工验收,当前 Windows CI 正在运行。

@1lck
1lck merged commit 14fe87e into 1lck:preview/0.3.0 Aug 19, 2026
7 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.

2 participants