Create a class for deferred error logging (#390)

## Link to GitHub Issue, if one exists
#388 

## Description of change
Instead of setting flags in `signal` and logging when we crash, create a
class for logging deferred semi-fatal messages, and dump them to the log
immediately before crashing or shutting down.

## Testing
Tested each failure case by injection.
This commit is contained in:
bicarus-dev
2025-10-02 18:42:49 -07:00
committed by GitHub
parent afbe013811
commit 32801319fa
10 changed files with 97 additions and 74 deletions
+2 -1
View File
@@ -13,6 +13,7 @@
#include "hooks/sleephook.h"
#include "hooks/winuser.h"
#include "touch/touch.h"
#include "util/deferlog.h"
#include "util/detour.h"
#include "util/logging.h"
#include "util/sigscan.h"
@@ -211,7 +212,7 @@ namespace games::sdvx {
return true;
}
if (data.find("SuperstepSound: Audio device is not available") != std::string::npos) {
launcher::signal::SUPERSTEP_SOUND_ERROR = TRUE;
deferredlogs::defer_error_messages(deferredlogs::SUPERSTEP_SOUND_ERROR_MESSAGE);
return false;
}
return false;