Implement Assertion properly, TID printing in debug builds

This commit is contained in:
Lion Kortlepel
2020-11-03 10:13:52 +01:00
parent 69f20bdf41
commit 2ec65d5b84
12 changed files with 62 additions and 12 deletions

View File

@@ -11,9 +11,11 @@
#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());
// we need to print to cout here as we might crash before all console output is handled,
// due to segfaults or asserts.
#ifdef DEBUG
std::cout << "(debug build) Thread '" << std::this_thread::get_id() << "' in " << func << " is " << what << std::endl;
#endif // DEBUG
}
std::string getDate() {