summaryrefslogtreecommitdiff
path: root/lib/common/Configuration.cpp
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2015-02-25 20:24:36 +0000
committerChris Wilson <chris+github@qwirx.com>2015-02-25 20:24:36 +0000
commitcc9a156387fc300b0086e85b370ea1ac599ef431 (patch)
treebf2f3590affa76d96d5992f8e9126e4174b78f76 /lib/common/Configuration.cpp
parentd63936c2f7959d6fff995ec10c91e24266b8c5d7 (diff)
Reduce verbosity of testcommon by hiding some log messages.
Diffstat (limited to 'lib/common/Configuration.cpp')
-rw-r--r--lib/common/Configuration.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/common/Configuration.cpp b/lib/common/Configuration.cpp
index f49f3c6e..8ce8d389 100644
--- a/lib/common/Configuration.cpp
+++ b/lib/common/Configuration.cpp
@@ -34,6 +34,8 @@ inline bool iw(int c)
static const char *sValueBooleanStrings[] = {"yes", "true", "no", "false", 0};
static const bool sValueBooleanValue[] = {true, true, false, false};
+const ConfigurationCategory ConfigurationVerify::VERIFY_ERROR("VerifyError");
+
ConfigurationVerifyKey::ConfigurationVerifyKey
(
std::string name,
@@ -212,8 +214,8 @@ std::auto_ptr<Configuration> Configuration::LoadAndVerify(
if(!rErrorMsg.empty())
{
// An error occured, return now
- BOX_ERROR("Error in Configuration::LoadInto: " <<
- rErrorMsg);
+ BOX_LOG_CATEGORY(Log::ERROR, ConfigurationVerify::VERIFY_ERROR,
+ "Error in Configuration::LoadInto: " << rErrorMsg);
return std::auto_ptr<Configuration>(0);
}
@@ -222,8 +224,11 @@ std::auto_ptr<Configuration> Configuration::LoadAndVerify(
{
if(!apConfig->Verify(*pVerify, std::string(), rErrorMsg))
{
- BOX_ERROR("Error verifying configuration: " <<
- rErrorMsg);
+ BOX_LOG_CATEGORY(Log::ERROR,
+ ConfigurationVerify::VERIFY_ERROR,
+ "Error verifying configuration: " <<
+ rErrorMsg.substr(0, rErrorMsg.size() > 0
+ ? rErrorMsg.size() - 1 : 0));
return std::auto_ptr<Configuration>(0);
}
}
@@ -425,7 +430,8 @@ const std::string &Configuration::GetKeyValue(const std::string& rKeyName) const
if(i == mKeys.end())
{
- BOX_ERROR("Missing configuration key: " << rKeyName);
+ BOX_LOG_CATEGORY(Log::ERROR, ConfigurationVerify::VERIFY_ERROR,
+ "Missing configuration key: " << rKeyName);
THROW_EXCEPTION(CommonException, ConfigNoKey)
}
else