Logs the current thread's id in assertions and for requests, resolves #3534

This commit is contained in:
Daniel J. Hofmann
2017-01-09 05:36:49 +01:00
committed by Patrick Niklaus
parent c1f833c80f
commit f82740ed93
2 changed files with 11 additions and 3 deletions
+5 -1
View File
@@ -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();
}