Logs the current thread's id in assertions and for requests, resolves #3534
This commit is contained in:
committed by
Patrick Niklaus
parent
c1f833c80f
commit
f82740ed93
+5
-1
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <exception>
|
||||
#include <iostream>
|
||||
#include <thread>
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -9,7 +10,10 @@ namespace
|
||||
[[noreturn]] void assertion_failed_msg_helper(
|
||||
char const *expr, char const *msg, char const *function, char const *file, long line)
|
||||
{
|
||||
std::cerr << "[assert] " << file << ":" << line << "\nin: " << function << ": " << expr << "\n"
|
||||
const auto tid = std::this_thread::get_id();
|
||||
|
||||
std::cerr << "[assert][" << tid << "] " << file << ":" << line << "\nin: " << function << ": "
|
||||
<< expr << "\n"
|
||||
<< msg;
|
||||
std::terminate();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user