Skip to content

feat(client): Enhance Log Viewer with Categories, Filtering, and Per-Session Tracing - #12

Merged
rcyw merged 1 commit into
mainfrom
feat/client-log-enhancements
Feb 28, 2026
Merged

feat(client): Enhance Log Viewer with Categories, Filtering, and Per-Session Tracing#12
rcyw merged 1 commit into
mainfrom
feat/client-log-enhancements

Conversation

@rcyw

@rcyw rcyw commented Feb 28, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR significantly enhances the debugging and observability capabilities of the Deck client by introducing several new features to the logging system and the Log Viewer UI.

Key Changes

  • ✨ Log Viewer Filtering:

    • Logs are now categorized as API, SSE, Error, or System.
    • The Log Viewer now has a filter bar, allowing developers to easily isolate specific types of events, which is especially useful for noisy applications.
  • 🗂️ Per-Session SSE Tracing:

    • To simplify debugging individual user flows, SSE traces are no longer written to a single monolithic file.
    • They are now stored in a sessions directory, with one .jsonl file per session_id.
    • Includes an automatic cleanup mechanism to evict old log files based on age and total directory size, preventing uncontrolled disk usage.
  • 🌉 Frontend Log Bridge:

    • A new Tauri command (log_frontend_message) has been added.
    • console.error and console.warn are now automatically forwarded to the Rust backend and captured in the main deck.log. This allows us to capture critical frontend errors that might otherwise be lost in production desktop builds.

How to Test

  1. Run the client application.
  2. Open the debug/log viewer.
  3. Observe the new category filter buttons (API, SSE, Error, System).
  4. Click the filters to verify that the log entries are correctly shown or hidden.
  5. Perform some actions (e.g., send a message) and verify new log entries appear under the correct categories.
  6. Check your app's log directory (<App Log Dir>/sessions/) and confirm that .jsonl files are being created for your sessions.

Implements a major enhancement to the client-side log viewer and underlying logging infrastructure.

Key changes include:

- **Log Categories & Filtering:** Introduces 'api', 'sse', 'error', and 'system' categories. The log viewer UI now includes filter buttons to toggle visibility for each category, allowing developers to focus on relevant events.
- **Per-Session SSE Tracing:** The SSE file trace mechanism now creates a separate log file for each session (). This dramatically improves the experience of debugging a specific user session.
- **Log File Rotation:** Implemented an automatic cleanup and eviction policy for the session trace directory to manage disk space usage by removing old or oversized logs.
- **Frontend Console Bridge:**  and  messages from the frontend are now bridged to the Tauri backend, ensuring they are captured in the main application log file in production builds.
@rcyw
rcyw merged commit ffc40be into main Feb 28, 2026
@rcyw
rcyw deleted the feat/client-log-enhancements branch February 28, 2026 15:45
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.

1 participant