# HG changeset patch # User Alain Mazy # Date 1783326540 -7200 # Node ID 0865c7118efa60e24ff7556609dfa6558b34a363 # Parent f8b713a8f9b4e6f17c49845016566fe57010f88f fix caller thread name in context diff -r f8b713a8f9b4 -r 0865c7118efa OrthancFramework/Sources/Logging.cpp --- a/OrthancFramework/Sources/Logging.cpp Tue Jun 30 11:02:55 2026 +0200 +++ b/OrthancFramework/Sources/Logging.cpp Mon Jul 06 10:29:00 2026 +0200 @@ -46,6 +46,8 @@ { namespace Logging { + static bool logCallerThreadNameInContext = false; // add a "from THREADNAME" in the context everytime the context is copied from a thread to the other to help track the runnable/callable journey + static const uint32_t ALL_CATEGORIES_MASK = 0xffffffff; static uint32_t infoCategoriesMask_ = 0; @@ -1120,12 +1122,10 @@ ThreadContextMemento::ScopedSetter::ScopedSetter(const ThreadContextMemento& memento) : count_(memento.pimpl_->context_.size()) { - if (false) // additional debug information: add the caller thread name + if (logCallerThreadNameInContext && enableThreadNames_) { - if (enableThreadNames_) - { - PushCurrentThreadContext("from " + GetCurrentThreadName()); - } + count_++; + PushCurrentThreadContext("from " + GetCurrentThreadName()); } for (std::list::const_iterator it = memento.pimpl_->context_.begin(); it != memento.pimpl_->context_.end(); ++it)