yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
crash_handler.h
Go to the documentation of this file.
1#ifndef YAZE_UTIL_CRASH_HANDLER_H
2#define YAZE_UTIL_CRASH_HANDLER_H
3
4#include <filesystem>
5#include <string>
6
7namespace yaze {
8namespace util {
9
31 public:
39 static void Initialize(const std::string& version);
40
45 static std::filesystem::path GetCrashLogDirectory();
46
51 static std::filesystem::path GetMostRecentCrashLog();
52
57 static bool HasUnacknowledgedCrashLog();
58
64 static void AcknowledgeCrashLog();
65
70 static void CleanupOldLogs(int keep_count = 5);
71
72 private:
73 static std::string version_;
74 static std::filesystem::path crash_log_path_;
75 static int crash_log_fd_;
76
77 // Custom writer function for absl failure signal handler
78 static void CrashLogWriter(const char* data);
79};
80
81} // namespace util
82} // namespace yaze
83
84#endif // YAZE_UTIL_CRASH_HANDLER_H
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 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 void AcknowledgeCrashLog()
Mark the current crash log as acknowledged.
static std::string version_
static std::filesystem::path GetMostRecentCrashLog()
Get the path to the most recent crash log, if any.
static std::filesystem::path crash_log_path_