Repository navigation
Panics are logged on every system, not only on Windows - #300
Conversation
The panic hook now starts with the log everywhere: on macOS a panic reaches the unified log, on Linux stderr, on Windows hush.log as before. The panic test goes through init, and the README says where the log is on each system.
…nux binary is Also: the panic comments say std's hook prints the panic unscrubbed, and why the test expects one line.
Review (pr-review-toolkit: code, tests, comments/docs, failure paths) and what was doneFixed in acd0c42:
Declined:
For the owner (product call, unchanged here):
Gate after the fixes, on the head merged with main ( |
std's hook prints the panic as it is, ids and all: only a debug build still calls it, for its report and RUST_BACKTRACE backtrace.
|
Owner's ruling on the raw duplicate (the rule that ids stay out of logs, #176), done in 88dc932: std's own hook now runs only in a debug build ( |
What changed
sig_core::logging::init(the desktop app's first line, andClient::open) now callslog_panicseverywhere. A panic is logged aspanicked at <file>:<line>:<col>: <message>through the same scrubbed log. std's own hook (itsthread '…' panicked at …on stderr, with a backtrace underRUST_BACKTRACE=1) then runs only in a debug build: it prints the message as it is, ids and all, so a release build logs only the scrubbed line (the rule that ids stay out of logs, Group keys and contact ids stay out of logs, file names, notifications and preferences #176). Where the line goes:dev.pitis.hush, categorycore(tracing-oslog files an ERROR as a Fault, so it is kept).hush.logand stderr, as since On Windows Hush writes a small log file, panics too, since it has no console #289 (a release build no longer adds std's raw report to stderr).core/sig-core/src/logging.rs: the twocfggates (#[cfg(windows)]on the call,#[cfg(any(windows, test))]onlog_panics) are gone, and the module doc says panics go with the log on every system.log show --predicate 'subsystem == "dev.pitis.hush"' --last 1hin Terminal, or Console.app live; Linux stderr (~/.local/bin/hushin a terminal), from the launcher usually the user journal (journalctl --user -b); Windowshush.log(already there). Development: a panic is one scrubbed line on every system; only a debug build (make run,cargo run) also prints Rust's report, with a backtrace underRUST_BACKTRACE=1.Why
Owner's decision of 2026-11-29: a Hush.app opened from Finder, or Hush started from a Linux launcher, had nowhere to print a panic.
Re-checked against the code
log_panicsdirectly, so it never showed thatinitinstalls the hook. It now callsinit(as the app does) and checks the panic is logged exactly once (it was "any", with a note that Windows could log it twice; with the hook only underinit'sOncethere is one).How it was tested
a_panic_is_logged_with_its_place_and_scrubbedthroughinit, run on macOS before the change: failed (left: 0, right: 1, no panic line); after it: passes.initand panicked insidecatch_unwindwith no test subscriber, so the line went to the global oslog layer; then/usr/bin/log show --predicate 'subsystem == "dev.pitis.hush"'had[dev.pitis.hush:core] panicked at sig-core/src/logging.rs:463:45: probe-298 with <redacted>(the UUID in the message blanked).make update):make formatno changes,make checkpasses:cargo fmt --check, both clippy runs (-D warnings, plain and--features hush-desktop/snapshot),cargo test --features hush-desktop/snapshot(402 + 553 passed, 4 ignored). An earlier run failed onlya_long_history_draws_as_fast_as_a_short_one, a frame-time ratio test, at load average ~150 from other builds; it passes at normal load.cfg!(debug_assertions), and checking a release build's panic incargo testwould mean a release build of the core; the debug side is what the panic test runs.Closes #298