From d41cdc4dff8e77bfdac49515eec5bdd34531c101 Mon Sep 17 00:00:00 2001 From: Ykkrosh Date: Sun, 15 Aug 2004 21:10:49 +0000 Subject: [PATCH] Allow NULL categories, and make them very interesting This was SVN commit r996. --- source/ps/CLogger.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/ps/CLogger.cpp b/source/ps/CLogger.cpp index ce5642e67a..398179626e 100755 --- a/source/ps/CLogger.cpp +++ b/source/ps/CLogger.cpp @@ -192,15 +192,22 @@ int CLogger::Interestedness(const char* category) // easy run-time alteration of interest levels (and shouldn't be particularly // slow) + // Category unspecified: use a high interest level to encourage + // people to categorise their errors + if (category == NULL) + return 2; + // If the config DB hasn't been loaded, assume the default if (! g_ConfigDB.IsInitialised()) return 1; CConfigValue* v = g_ConfigDB.GetValue(CFG_SYSTEM, CStr("loginterest.")+category); + // If the value is unspecified, also use the default if (!v) return 1; int level; + // Something failed, so the default value might be a good alternative if (! v->GetInt(level)) return 1;