summaryrefslogtreecommitdiff
path: root/indra/llcommon/llerrorcontrol.h
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/llerrorcontrol.h
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/llerrorcontrol.h')
-rwxr-xr-xindra/llcommon/llerrorcontrol.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/indra/llcommon/llerrorcontrol.h b/indra/llcommon/llerrorcontrol.h
index 56ac52e5de..56e84f7172 100755
--- a/indra/llcommon/llerrorcontrol.h
+++ b/indra/llcommon/llerrorcontrol.h
@@ -189,6 +189,11 @@ namespace LLError
LL_COMMON_API std::string abbreviateFile(const std::string& filePath);
LL_COMMON_API int shouldLogCallCount();
+
+ // Check whether Globals exists. This should only be used by LLSingleton
+ // infrastructure to avoid trying to log when our internal LLSingleton is
+ // unavailable -- circularity ensues.
+ LL_COMMON_API bool is_available();
};
#endif // LL_LLERRORCONTROL_H