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
+4
View File
@@ -7,6 +7,7 @@
#include "easrv/easrv.h"
#include "rawinput/rawinput.h"
#include "hooks/audio/audio.h"
#include "util/deferlog.h"
#include "util/logging.h"
#include "launcher.h"
@@ -21,6 +22,9 @@ namespace launcher {
// therefore, subsystems need to be guarded against multiple unload attempts
log_info("launcher", "stopping subsystems");
// before shutting down logger, dump any deferred log messages
deferredlogs::dump_to_logger();
// flush/stop logger
logger::stop();