1#ifndef YAZE_UTIL_CRASH_HANDLER_H
2#define YAZE_UTIL_CRASH_HANDLER_H
42 static void Initialize(
const std::string& version);
88 const std::filesystem::path& directory);
97 const std::filesystem::path& directory);
Manages crash logging for release builds.
static void CleanupOldLogs(int keep_count=5)
Clean up old crash logs, keeping only the most recent N logs.
static bool IsHeaderOnlyCrashLog(const std::filesystem::path &path)
True if the file holds only the report header, with nothing written by the signal handler after it.
static void OpenCrashLogFromSignalHandler()
static void CrashLogWriter(const char *data)
static void Initialize(const std::string &version)
Initialize the crash handler for the application.
static std::filesystem::path GetCrashLogDirectory()
Get the path where crash logs are stored.
static bool HasUnacknowledgedCrashLog()
Check if there's a crash log from a previous session.
static std::filesystem::path PendingCrashLogPathForTesting()
static void AcknowledgeCrashLog()
Mark the current crash log as acknowledged.
static std::string version_
static void PrepareCrashLog(const std::string &version, const std::filesystem::path &directory)
static std::filesystem::path GetMostRecentCrashLog()
Get the path to the most recent crash log, if any.
static std::filesystem::path crash_log_path_
static void WriteCrashLogForTesting(const char *data)
static void ResetForTesting()
static void PrepareCrashLogForTesting(const std::string &version, const std::filesystem::path &directory)