feat(desktop): verbose logging toggle + Sentry/PostHog instrumentation expansion#1769
Draft
richiemcilroy wants to merge 2 commits intomainfrom
Draft
feat(desktop): verbose logging toggle + Sentry/PostHog instrumentation expansion#1769richiemcilroy wants to merge 2 commits intomainfrom
richiemcilroy wants to merge 2 commits intomainfrom
Conversation
…eneral settings Adds a Diagnostics section to General Settings that lets users opt into trace-level logging at runtime via tracing-subscriber's reload handle. Includes Reveal Logs and Upload Logs buttons, and persists the preference so verbose logging is re-applied on startup. Exposes set_verbose_logging and open_logs_folder Tauri commands. Co-authored-by: Richie McIlroy <richiemcilroy@users.noreply.github.com>
- Add sentry-tracing layer so every error!()/warn!()/info!() call across the recording, encoding, upload, render and editor pipelines feeds Sentry as breadcrumbs (warn/info) and events (error) automatically. - Tag the Sentry scope at startup with os, arch, cap_version, instance_id, cap_backend (cloud vs self_hosted) and the verbose logging state, so issues are filterable per environment. - Capture export failures with format, fps, cursor_only, force_ffmpeg context and project path on the Sentry scope. - Promote silent wgpu adapter / device init failures to error logs so GPU init issues now flow through Sentry. - Extend MultipartUploadFailed PostHog event with stage, retry count and bytes uploaded, and use the recording's actual capture target resolution for RecordingStarted instead of zeros. Co-authored-by: Richie McIlroy <richiemcilroy@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two complementary changes that make support diagnoses dramatically easier:
1. Verbose logging toggle (General Settings → Diagnostics)
Adds a Diagnostics card to General Settings with three controls:
tracing_subscriberlevel filter toTRACEat runtime via areload::Layer, so every span/event from the recording, rendering, export, and upload pipelines is captured to the rolling log file. Persisted across restarts inGeneralSettingsStore.~/Library/Logs/so.cap.desktopon macOS,%LOCALAPPDATA%/so.cap.desktop/logson Windows) viatauri-plugin-opener.upload_logsflow next to the toggle so users can ship the captured trace logs in one click after reproducing.Implemented via
tracing_subscriber::reload::Layer<LevelFilter, _>inmain.rs, a smallVerboseLoggingHandlemanaged in Tauri state, and two newset_verbose_logging/open_logs_foldercommands.2. Always-on telemetry coverage (no toggle required)
So we don't always need users to flip the toggle and re-upload to diagnose issues, the Sentry/PostHog surface is now far richer by default:
sentry-tracinglayer — everyerror!()event becomes a Sentry event, and everywarn!()/info!()rides along as a breadcrumb. The desktop app already has hundreds of structured tracing calls across recording, encoder, muxer, upload, camera, mic, GPU, and editor flows; they now all flow into Sentry automatically with their fields and span context attached.os,arch,cap_version,instance_id,cap_backend(cloud vs self_hosted),verbose_loggingstate. This lets us filter issues per environment.with_scopeaddsexport.format,export.fps,export.cursor_only,export.force_ffmpeg, andproject_pathto the captured Sentry message instead of just the bare error string.wgpu::request_adapter/request_deviceerrors that previously dropped silently via.ok()?are now logged witherror!(adapter_name,adapter_backend,adapter_device_type,error) so they reach Sentry.multipart_upload_failedPostHog event gainsstage(video_join/instant_multipart/studio_segment),retried_chunk_count, andbytes_uploaded_mbso we can tell which upload path is breaking and how far it got.recording_startedPostHog event now sends realtarget_width/target_heightderived from the capture target's display / area bounds (was hardcoded to0).Walkthrough
Manual UI testing was not run — this cloud agent is Linux, but the desktop crate (
scap-targets,whisper-rs-sys,cidre, …) only builds on macOS / Windows. The Rust changes passcargo checkforsentry-tracingresolution and were carefully matched against existing patterns:sentry::integrations::tracing::layer()with the recommendedEventFiltermapping.sentry::configure_scopeblock that already runs at startup.sentry::with_scopeso they apply only to the captured failure.request_devicealready returnsResult<(Device, Queue), Error>in wgpu 25 (matches existing usage inscreenshot_editor.rs).The desktop CI matrix on macOS + Windows runners exercises the full clippy
-D warningsgate.Notes
Cargo.tomladds thetracingfeature onsentry.Cargo.lockupdated.tauri.tsis regenerated by tauri-specta but tracked in this repo (see priorchore(desktop): regenerate tauri bindings ...commits). Updated by hand in lockstep with the new commands andGeneralSettingsStorefield — the next debug run will produce the same output.enable_telemetryopt-out: all PostHog events still respect the existing telemetry toggle, and Sentry is only initialised whenCAP_DESKTOP_SENTRY_URLis set at compile time (release builds only, debug builds drop events viabefore_send).