@@ -320,7 +320,10 @@ void Server::logToClient(void *channel, const loguru::Message &message) {
320320 if (data == nullptr ) {
321321 throw BaseException (" Couldn't handle logging to client, data is null" );
322322 }
323- if (std::string (message.thread_name ) == data->client &&
323+ vector <char > thread_name (data->client .size ());
324+ loguru::get_thread_name (thread_name.data (), sizeof (data->client .size ()), false );
325+
326+ if (std::string (thread_name.begin (), thread_name.end ()) == data->client &&
324327 std::string (message.filename ) != std::string (GTestLogger::fileName ())) {
325328 LogEntry logEntry;
326329 std::string extractedMessage = extractMessage (message);
@@ -335,7 +338,10 @@ void Server::gtestLog(void *channel, const loguru::Message &message) {
335338 if (data == nullptr ) {
336339 throw BaseException (" Can't interpret gtest log channel" );
337340 }
338- if (std::string (message.thread_name ) == data->client &&
341+ vector <char > thread_name (data->client .size ());
342+ loguru::get_thread_name (thread_name.data (), sizeof (data->client .size ()), false );
343+
344+ if (std::string (thread_name.begin (), thread_name.end ()) == data->client &&
339345 std::string (message.filename ) == std::string (GTestLogger::fileName ())) {
340346 LogEntry logEntry;
341347 logEntry.set_message (message.message );
@@ -366,9 +372,9 @@ Status Server::TestsGenServiceImpl::provideLoggingCallbacks(
366372 loguru::add_callback (callbackName.c_str (), handler, &data,
367373 loguru::get_verbosity_from_name (logLevel.c_str ()));
368374 if (openFiles) {
369- loguru::add_file (allLogPath.c_str (), client. c_str (), loguru::Append,
375+ loguru::add_file (allLogPath.c_str (), loguru::Append,
370376 loguru::Verbosity_MAX);
371- loguru::add_file (latestLogPath.c_str (), client. c_str (), loguru::Truncate,
377+ loguru::add_file (latestLogPath.c_str (), loguru::Truncate,
372378 loguru::Verbosity_INFO);
373379 }
374380 holdLockFlag[callbackName] = true ;
0 commit comments