Skip to content

Commit

Permalink
Merge pull request #2535 from div72/port_pr_25256
Browse files Browse the repository at this point in the history
logging: fix logging empty thread name
  • Loading branch information
jamescowens authored Jul 5, 2022
2 parents 5fd549e + 0cf8c1d commit 26ff978
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ void BCLog::Logger::LogPrintStr(const std::string& str)
std::string str_prefixed = LogEscapeMessage(str);

if (m_log_threadnames && m_started_new_line) {
str_prefixed.insert(0, "[" + util::ThreadGetInternalName() + "] ");
const auto threadname = util::ThreadGetInternalName();
str_prefixed.insert(0, "[" + (threadname.empty() ? "unknown" : threadname) + "] ");
}

str_prefixed = LogTimestampStr(str_prefixed);
Expand Down

0 comments on commit 26ff978

Please sign in to comment.