Skip to content

Commit 22f4ab5

Browse files
committed
Logging: Unify FE+BE logging with tauri-plugin-log
- Replace env_logger with tauri-plugin-log + env_filter (RUST_LOG still works) - Add batching log bridge: FE logs → Rust log facade → terminal + file - 100ms batch window, consecutive dedup (×N suffix), 200/s throttle - Shorter log format: "10:19:34.90 INFO indexing::writer msg" - Colored terminal output via fern - Log file at ~/Library/Logs/ with 50 MB rotation - Migrate feLog() call sites (viewer, updater) to getAppLogger() - Delete ad-hoc feLog/fe_log bridge - Wire verbose logging toggle to also set Rust log level at runtime - "Open log file" button now opens actual log directory
1 parent 075c1d4 commit 22f4ab5

20 files changed

Lines changed: 1027 additions & 222 deletions

File tree

AGENTS.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,11 @@ Run the smallest set of checks possible for efficiency while maintaining confide
6161

6262
## Debugging
6363

64+
- **Unified logging**: Frontend and backend logs appear together in the terminal and in a shared log file at
65+
`~/Library/Logs/com.veszelovszki.cmdr/`. The log file is also accessible from Settings > Logging > "Open log file".
6466
- **Svelte/TypeScript**: Use LogTape via `getAppLogger('feature')` from `$lib/logger`. Levels: debug, info, warn, error.
6567
Dev mode shows info+, prod shows error+ only. Enable debug for a feature by adding to `debugCategories` in logger.ts.
66-
- **Rust**: Uses `env_logger` with `RUST_LOG` var. Default: info. Example: `RUST_LOG=cmdr_lib::network=debug pnpm dev`.
68+
- **Rust**: Uses `tauri-plugin-log` with `RUST_LOG` var. Default: info. Example: `RUST_LOG=cmdr_lib::network=debug pnpm dev`.
6769
It's usually worth adding `,smb=warn,sspi=warn,info` too to suppress some excessive logging from smb, unless you're
6870
debugging SMB issues.
6971
- When ran with `pnpm dev`, Cmdr hot reloads on file changes. Takes max 15s for back-end changes, max 3s on front-end.

0 commit comments

Comments
 (0)