|
OpenTTD Source
14.0-beta3
|
Go to the documentation of this file.
13 #include "3rdparty/nlohmann/json.hpp"
28 virtual void SurveyCrash(nlohmann::json &survey)
const = 0;
46 virtual bool TryExecute(std::string_view section_name, std::function<
bool()> &&func) = 0;
49 std::string
CreateFileName(
const char *ext,
bool with_dir =
true)
const;
55 nlohmann::json survey;
56 std::string crashlog_filename;
57 std::string crashdump_filename;
58 std::string savegame_filename;
59 std::string screenshot_filename;
62 void PrintCrashLog()
const;
static void AfterCrashLogCleanup()
Try to close the sound/video stuff so it doesn't keep lingering around incorrect video states or so,...
bool WriteCrashLog()
Write the crash log to a file.
virtual void SurveyCrash(nlohmann::json &survey) const =0
Convert system crash reason to JSON.
void MakeCrashLog()
Makes the crash log, writes it to a file and then subsequently tries to make a crash dump and crash s...
virtual ~CrashLog()=default
Stub destructor to silence some compilers.
void FillCrashLog()
Fill the crash log buffer with all data of a crash log.
static void InitThread()
Prepare crash log handler for a newly started thread.
Helper class for creating crash logs.
std::string CreateFileName(const char *ext, bool with_dir=true) const
Create a timestamped filename.
bool WriteScreenshot()
Write the (crash) screenshot to a file.
static void InitialiseCrashLog()
Initialiser for crash logs; do the appropriate things so crashes are handled by our crash handler ins...
static void SetErrorMessage(const std::string &message)
Sets a message for the error message handler.
void SendSurvey() const
Send the survey result, noting it was a crash.
static std::string message
Error message coming from #FatalError(format, ...).
virtual bool WriteCrashDump()
Write the (crash) dump to a file.
virtual bool TryExecute(std::string_view section_name, std::function< bool()> &&func)=0
Execute the func() and return its value.
bool WriteSavegame()
Write the (crash) savegame to a file.
virtual void SurveyStacktrace(nlohmann::json &survey) const =0
Convert stacktrace to JSON.