Expand description
Diagnostics: log level control and the exportable bug-report bundle.
TRACES: UR-078 | DR-218
The app used to forget everything it did the moment it exited. A user
reporting “the episode randomly restarted” was reporting the symptom of a
race whose evidence had been discarded microseconds later, and the only way
to recover it was to talk them through adb logcat — which is how several
bugs in this project’s history actually got diagnosed.
This module is the other half of that: the log is on disk, it survives a crash, and the user can hand the whole thing over as one file.
Everything written here has been through crate::utils::diagnostics::redact
twice — once in the log formatter, and again on the way into the archive, so
files written by a build that predates the formatter pass are covered too.
Structs§
- Diagnostics
Bundle - Where an export landed, so the UI can tell the user where to find it.
- Diagnostics
Info - Where logs live and how verbose they currently are.
Constants§
- LEVEL_
FILE 🔒 - Name of the file holding the user’s chosen level, in the app config dir.
Functions§
- diagnostics_
export - Write a redacted diagnostics archive and return where it went.
- diagnostics_
get_ info - Current log level and where the files are.
- diagnostics_
set_ level - Set the log level, for this session and the next.
- environment_
summary 🔒 - A short, non-identifying description of the environment.
- level_
name 🔒 - log_
files 🔒 - Collect every log file in the log directory, newest first.
- parse_
level - Parse a stored/user-supplied level name.
- stored_
level - Read the persisted level, if the user has ever set one.