diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2022-05-27 02:51:33 +0300 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2022-05-27 02:51:33 +0300 |
commit | 3da7a50b71d4ef5919c2d4d5b9547b3ef0abab7d (patch) | |
tree | c51119f79b734a7d503bb3adeac1759b819c8f92 /indra/llcommon/llerror.cpp | |
parent | 3c215ee885f846f4ab4923c03b51f1b2203394af (diff) | |
parent | cdbd06e8ed6e3f4285a61f5c0b607a65dfdf8dfd (diff) |
Merge branch 'master' into DRTVWR-543-maint
# Conflicts:
# autobuild.xml
# indra/cmake/LLCommon.cmake
# indra/llcommon/CMakeLists.txt
# indra/llrender/llgl.cpp
# indra/newview/llappviewer.cpp
# indra/newview/llface.cpp
# indra/newview/llflexibleobject.cpp
# indra/newview/llvovolume.cpp
Diffstat (limited to 'indra/llcommon/llerror.cpp')
-rw-r--r-- | indra/llcommon/llerror.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 55a06f8326..919d2dabc4 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -109,6 +109,7 @@ namespace { virtual void recordMessage(LLError::ELevel level, const std::string& message) override { + LL_PROFILE_ZONE_SCOPED_CATEGORY_LOGGING int syslogPriority = LOG_CRIT; switch (level) { case LLError::LEVEL_DEBUG: syslogPriority = LOG_DEBUG; break; @@ -166,6 +167,7 @@ namespace { virtual void recordMessage(LLError::ELevel level, const std::string& message) override { + LL_PROFILE_ZONE_SCOPED_CATEGORY_LOGGING if (LLError::getAlwaysFlush()) { mFile << message << std::endl; @@ -194,7 +196,7 @@ namespace { { return LLError::getEnabledLogTypesMask() & 0x04; } - + LL_FORCE_INLINE std::string createBoldANSI() { std::string ansi_code; @@ -220,10 +222,10 @@ namespace { LL_FORCE_INLINE std::string createANSI(const std::string& color) { std::string ansi_code; - ansi_code += '\033'; - ansi_code += "["; + ansi_code += '\033'; + ansi_code += "["; ansi_code += "38;5;"; - ansi_code += color; + ansi_code += color; ansi_code += "m"; return ansi_code; @@ -232,6 +234,7 @@ namespace { virtual void recordMessage(LLError::ELevel level, const std::string& message) override { + LL_PROFILE_ZONE_SCOPED_CATEGORY_LOGGING // The default colors for error, warn and debug are now a bit more pastel // and easier to read on the default (black) terminal background but you // now have the option to set the color of each via an environment variables: @@ -261,6 +264,7 @@ namespace { } else { + LL_PROFILE_ZONE_NAMED("fprintf"); fprintf(stderr, "%s\n", message.c_str()); } } @@ -270,6 +274,7 @@ namespace { LL_FORCE_INLINE void writeANSI(const std::string& ansi_code, const std::string& message) { + LL_PROFILE_ZONE_SCOPED_CATEGORY_LOGGING static std::string s_ansi_bold = createBoldANSI(); // bold text static std::string s_ansi_reset = createResetANSI(); // reset // ANSI color code escape sequence, message, and reset in one fprintf call @@ -306,6 +311,7 @@ namespace { virtual void recordMessage(LLError::ELevel level, const std::string& message) override { + LL_PROFILE_ZONE_SCOPED_CATEGORY_LOGGING mBuffer->addLine(message); } @@ -332,6 +338,7 @@ namespace { virtual void recordMessage(LLError::ELevel level, const std::string& message) override { + LL_PROFILE_ZONE_SCOPED_CATEGORY_LOGGING debugger_print(message); } }; @@ -1210,6 +1217,7 @@ namespace void writeToRecorders(const LLError::CallSite& site, const std::string& message) { + LL_PROFILE_ZONE_SCOPED_CATEGORY_LOGGING LLError::ELevel level = site.mLevel; SettingsConfigPtr s = Globals::getInstance()->getSettingsConfig(); @@ -1344,6 +1352,7 @@ namespace LLError bool Log::shouldLog(CallSite& site) { + LL_PROFILE_ZONE_SCOPED_CATEGORY_LOGGING LLMutexTrylock lock(getMutex<LOG_MUTEX>(), 5); if (!lock.isLocked()) { @@ -1388,6 +1397,7 @@ namespace LLError void Log::flush(const std::ostringstream& out, const CallSite& site) { + LL_PROFILE_ZONE_SCOPED_CATEGORY_LOGGING LLMutexTrylock lock(getMutex<LOG_MUTEX>(),5); if (!lock.isLocked()) { |