mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2025-07-01 23:35:41 +00:00
Add TID debug printing
This commit is contained in:
parent
289bb1c1f3
commit
69f20bdf41
@ -5,6 +5,8 @@
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
void InitLog();
|
||||
#define DebugPrintTID(what) DebugPrintTIDInternal(what, __func__)
|
||||
void DebugPrintTIDInternal(const std::string& what, const std::string& func); // prints the current thread id in debug mode, to make tracing of crashes and asserts easier
|
||||
void ConsoleOut(const std::string& msg);
|
||||
void except(const std::string& toPrint);
|
||||
void debug(const std::string& toPrint);
|
||||
|
@ -8,6 +8,13 @@
|
||||
#include <sstream>
|
||||
#include <chrono>
|
||||
#include <mutex>
|
||||
#include <thread>
|
||||
|
||||
void DebugPrintTIDInternal(const std::string& what, const std::string& func) {
|
||||
std::stringstream ss;
|
||||
ss << "Thread '" << std::this_thread::get_id() << "' in " << func << " is " << what;
|
||||
debug(ss.str());
|
||||
}
|
||||
|
||||
std::string getDate() {
|
||||
typedef std::chrono::duration<int, std::ratio_multiply<std::chrono::hours::period, std::ratio<24>>::type> days;
|
||||
|
Loading…
x
Reference in New Issue
Block a user