From 3cf9e0594f2d71adcf21ac5bf9deb37a0dffe604 Mon Sep 17 00:00:00 2001 From: pionere Date: Sun, 26 Nov 2023 12:17:33 +0100 Subject: [PATCH] add timestamp to the message before it is added to the queue (debug) --- Source/debug.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/debug.cpp b/Source/debug.cpp index a2b27160522..fafec33ca4c 100644 --- a/Source/debug.cpp +++ b/Source/debug.cpp @@ -1252,6 +1252,11 @@ void LogErrorQ(const char* msg, ...) va_end(va); + using namespace std::chrono; + milliseconds ms = duration_cast(system_clock::now().time_since_epoch()); + snprintf(tmp, sizeof(tmp), "%s @ %llu", tmp, ms.count()); + // snprintf(tmp, sizeof(tmp), "%s @ %u", tmp,gdwGameLogicTurn); + errorMsgQueue.push_back(tmp); } @@ -1265,11 +1270,6 @@ void LogDumpQ() for (const std::string &msg : errorMsgQueue) { fputs(msg.c_str(), f0); - using namespace std::chrono; - milliseconds ms = duration_cast(system_clock::now().time_since_epoch()); - //snprintf(tmp, sizeof(tmp), " @ %llu", ms.count()); - snprintf(tmp, sizeof(tmp), " @ %u", gdwGameLogicTurn); - fputs(tmp, f0); fputc('\n', f0); }