Expand description
Crash reports (ADR-0079): what a backend’s panic hook writes through the
game’s Storage, and what the game hears of it at its next start
(Setup::last_crash).
A report (CrashReport) is stored at crash-<when> (crash_key),
when being milliseconds since 1970 on the backend’s clock. It holds the
panic’s message, place, thread and backtrace, the engine’s, the game’s
and the target’s versions, the frame and the screen that was running,
the last lines of the log and the game’s own record of its play. It never
holds the player’s settings, saves or keymap, nor what the player typed
unless the game’s record holds it. Reports stay on the machine.
A report is a record in storage, like the settings and the profiles, not
an asset kind a game ships, so no format is registered for it. Its reader
(CrashReport::parse) still keeps ADR-0007 §5: a size limit, errors and
never a panic.
Structs§
- Crash
Report - What a backend’s panic hook found: plain data, written with
to_textand read withparse. Every field butversionandmessagemay be missing from a report’s text, so a newer field never stops an older report from reading. - Last
Crash - What a game hears at its start of the last crash: when, the message and the place, and the report’s key in its storage. What the player sees of it, if anything, is the game’s to word.
Constants§
- BACKTRACE_
BYTES - The longest backtrace kept, in bytes.
- ENGINE_
VERSION - The engine’s version a report names: every
shuyi-*crate has the workspace’s. - LOG_
LINES - The most lines of the log kept: the last ones.
- LOG_
LINE_ BYTES - The longest line of the log kept, in bytes.
- MESSAGE_
BYTES - The longest message kept, in bytes.
- OFFERED_
KEY - The key that names the last report offered to the game
(
offer_last_crash). - RECORD_
BYTES - The longest record of the game’s play kept, in bytes: a longer one is
left out (
CrashReport::set_record). - REPORT_
VERSION - The version of the report’s text this build writes.
- TEXT_
BYTES - The longest text
CrashReport::parsereads, in bytes.
Functions§
- crash_
key - The key a report made at
whenis stored at:crash-<when>. - keep_
newest - Deletes all but the newest
nreports instorage. - offer_
last_ crash - The newest
fatalreport instoragenewer than the oneOFFERED_KEYnames; from then on it names the newest report, so each is offered or skipped once. A report that isn’t fatal, or doesn’t read, is skipped. - report_
keys - The keys of the reports in
storage, newest first. Every other key is ignored, and a storage that can’t list gives none. - report_
when - When the report at
keywas made, ifkeyis a report’s:crash-and digits only.