Debug: Extend random debug logging to also include state checksum updates

This commit is contained in:
Jonathan G Rennison
2021-01-18 00:58:43 +00:00
parent 4f44540eb9
commit aacb70d371
10 changed files with 37 additions and 2 deletions

View File

@@ -52,6 +52,7 @@ int _debug_linkgraph_level;
int _debug_sound_level;
#ifdef RANDOM_DEBUG
int _debug_random_level;
int _debug_statecsum_level;
#endif
const char *_savegame_DBGL_data = nullptr;
@@ -88,6 +89,7 @@ struct DebugLevel {
DEBUG_LEVEL(sound),
#ifdef RANDOM_DEBUG
DEBUG_LEVEL(random),
DEBUG_LEVEL(statecsum),
#endif
};
#undef DEBUG_LEVEL
@@ -140,7 +142,7 @@ static void debug_print(const char *dbg, const char *buf)
fflush(f);
}
#ifdef RANDOM_DEBUG
} else if (strcmp(dbg, "random") == 0) {
} else if (strcmp(dbg, "random") == 0 || strcmp(dbg, "statecsum") == 0) {
#if defined(UNIX) && defined(__GLIBC__)
static bool have_inited = false;
static FILE *f = nullptr;