Skip to content

Commit

Permalink
add timestamp to the message before it is added to the queue (debug)
Browse files Browse the repository at this point in the history
  • Loading branch information
pionere committed Nov 26, 2023
1 parent ca10f96 commit 3cf9e05
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Source/debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1252,6 +1252,11 @@ void LogErrorQ(const char* msg, ...)

va_end(va);

using namespace std::chrono;
milliseconds ms = duration_cast<milliseconds>(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);
}

Expand All @@ -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<milliseconds>(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);
}
Expand Down

0 comments on commit 3cf9e05

Please sign in to comment.