summaryrefslogtreecommitdiff
path: root/indra/llcommon/llerror.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2015-06-25 16:04:01 -0400
committerNat Goodspeed <nat@lindenlab.com>2015-06-25 16:04:01 -0400
commit0ea1b2a164e0d985c80c8a1afea4b31670efc907 (patch)
treea3f96265f90f7815909135760ca87fcc2d2b96ed /indra/llcommon/llerror.cpp
parentd792baf9f7220a374788b35789335a7ae2e62369 (diff)
MAINT-5232: Try to avoid circularity between LLError and LLSingleton.
Part of LLError's logging infrastructure is implemented with an LLSingleton. Therefore, attempts to log from within LLSingleton machinery could potentially go south if LLError's LLSingleton is not yet initialized. Introduce LLError::is_available() in llerrorcontrol.h and llerror.cpp. Make LLSingletonBase::logwarns() and logerrs() consult LLError::is_available() before attempting to use LL_WARNS or LL_ERRS, respectively. Moreover, make all LLSingleton internal logging use logwarns() and logerrs() instead of directly engaging LL_ERRS or LL_WARNS.
Diffstat (limited to 'indra/llcommon/llerror.cpp')
-rwxr-xr-xindra/llcommon/llerror.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp
index 2100989316..54524bbe8e 100755
--- a/indra/llcommon/llerror.cpp
+++ b/indra/llcommon/llerror.cpp
@@ -402,6 +402,11 @@ namespace
namespace LLError
{
+ bool is_available()
+ {
+ return Globals::instanceExists();
+ }
+
class SettingsConfig : public LLRefCount
{
friend class Settings;