When FAKESOCKET_LOG_ALWAYS_STDERR, output also the thread id

This commit is contained in:
Tor Lillqvist 2019-03-20 13:17:57 +02:00 committed by Tor Lillqvist
parent 345df913de
commit 08da078546

View file

@ -83,7 +83,7 @@ static std::string flush()
{
static bool alwaysStderr = std::getenv("FAKESOCKET_LOG_ALWAYS_STDERR") != nullptr;
if (alwaysStderr)
std::cerr << loggingBuffer.str() << std::endl;
std::cerr << std::this_thread::get_id() << ":" << loggingBuffer.str() << std::endl;
else if (loggingCallback != nullptr)
loggingCallback(loggingBuffer.str());
loggingBuffer.str("");