Skip to main content

Module diagnostics

Module diagnostics 

Source

Structs§

BreakClock
Per-kind interval clock: how long since this kind last fired and the configured interval, so the report can show “due in / overdue by”.
EnvFacts
Host windowing-environment facts, gathered from process env vars. Only meaningful on Linux (X11 vs Wayland, compositor); on macOS / Windows the windowing system is implied by the OS. Split from the gathering so the markdown rendering is unit-testable.
LiveReadings
Volatile readings gathered by the command from the OS / plugins: the idle probe, DND state, screen-lock, notification permission, and OS-level autostart. Bundled and passed into runtime_snapshot_section so that function touches only in-memory scheduler state — these probes go through X11 / dbus / plugin FFI that segfaults on the headless CI runner, so they must stay out of the testable path.
MonitorFacts
One monitor’s geometry for the report. Mirrors tauri::Monitor fields we care about, kept plain so format_monitors is testable.
RuntimeSnapshot
Everything the report needs to answer “why isn’t a break happening right now”. Gathered live from the scheduler + windowing system, then rendered by format_runtime_snapshot (kept pure for testing).
StartupFacts 🔒
Everything the startup banner reports, gathered by log_startup_banner so startup_banner stays pure.

Constants§

LOG_FILE_NAME 🔒
REPORT_LOG_BYTES 🔒

Functions§

break_kind_label 🔒
build_diagnostics_report
collapse_hint_pool 🔒
display_server 🔒
Best-effort name for the display server backing the app, used to triage overlay/transparency issues that only reproduce on one stack.
environment_section 🔒
format_break_clock 🔒
format_environment 🔒
Render the whole environment block from already-gathered facts. Pure: the caller does the env / windowing-system queries and passes the results in, so this formatting is fully unit-testable.
format_monitors 🔒
format_runtime_snapshot 🔒
gather_monitors 🔒
Describe every attached monitor, or None if the windowing main thread could not be asked — see crate::display::on_main_thread for why the read has to happen there and why calling it from either of this function’s callers (an async command task and the main-thread setup hook) is safe.
log_file_path 🔒
log_startup_banner
Gather the startup facts and emit the banner at info level. Called once from the Tauri setup hook.
next_due_secs 🔒
Seconds until the next break of a kind: positive = still counting down, zero or negative = overdue (the scheduler will fire as soon as no guard is suppressing it). i64 so overdue is representable.
os_description 🔒
read_monitor_facts 🔒
read_tail 🔒
redact_log_tail 🔒
redact_sensitive 🔒
runtime_snapshot_section 🔒
Build the Runtime section from in-memory scheduler state plus the already-gathered LiveReadings. No OS / plugin / AppHandle access, so it’s testable with a bare scheduler.
startup_banner 🔒
Compact one-line environment summary logged once at startup, so the log file (and therefore every diagnostics report’s log tail) always opens with the context a bug report needs — even if the user never generates a report. Pure so the formatting is unit-testable.