Player12
An open source football management simulator
Loading...
Searching...
No Matches
CrashReport Namespace Reference

Classes

struct  Pending
 

Functions

fs::path directory ()
 
void install ()
 
fs::path write (std::string_view reason)
 
std::optional< Pending > pending ()
 
void acknowledge ()
 

Detailed Description

Local crash reports. A fatal signal, an uncaught exception or an error reaching main() writes <logs>/crash-<utc>.txt (version, build, reason and, where available, a backtrace) and marks it pending; the next start shows a notice and keeps the crashed session's log next to it as crash-<utc>.log. Reports stay on this computer: nothing is ever sent anywhere.

Function Documentation

◆ acknowledge()

void CrashReport::acknowledge ( )

Marks the pending report as seen and keeps only the newest reports.

◆ directory()

std::filesystem::path CrashReport::directory ( )

Folder holding the reports and logs.

◆ install()

void CrashReport::install ( )

Installs the fatal signal and std::terminate handlers. Call once at startup, after Logger::init() (which keeps the previous session's log).

◆ pending()

std::optional< Pending > CrashReport::pending ( )

The report left by a crashed earlier session, if not acknowledged.

◆ write()

std::filesystem::path CrashReport::write ( std::string_view  reason)

Writes a report for a fatal error the program caught itself (not for use in signal handlers). Only the first report of a process is written.

Returns
The report file.