diff --git a/indra/llcommon/llcallstack.h b/indra/llcommon/llcallstack.h index 5acf04a49f..b9b9d54a27 100644 --- a/indra/llcommon/llcallstack.h +++ b/indra/llcommon/llcallstack.h @@ -79,9 +79,22 @@ struct LLContextStatus LL_COMMON_API std::ostream& operator<<(std::ostream& s, const LLContextStatus& context_status); +// Store the check to avoid the nasty mutex monster that lies within +// Note that this won't work quite as expected if called with a variable tag +// No current use cases do this though, nor are they likely. +/* #define dumpStack(tag) \ +- if (debugLoggingEnabled(tag)) \ +- { \ +- LLCallStack cs; \ +- LL_DEBUGS(tag) << "STACK:\n" << "====================\n" << cs << "====================" << LL_ENDL; \ +- } +*/ #define dumpStack(tag) \ - if (debugLoggingEnabled(tag)) \ - { \ - LLCallStack cs; \ - LL_DEBUGS(tag) << "STACK:\n" << "====================\n" << cs << "====================" << LL_ENDL; \ - } + { static auto _isTagEnabled = debugLoggingEnabled(tag); \ + if (_isTagEnabled) \ + { \ + LLCallStack cs; \ + LL_DEBUGS(tag) << "STACK:\n" << "====================\n" << cs << "====================" << LL_ENDL; \ + } \ + } +// \ No newline at end of file