summaryrefslogtreecommitdiff
path: root/i/marvin/src/log/log.cc
diff options
context:
space:
mode:
Diffstat (limited to 'i/marvin/src/log/log.cc')
-rw-r--r--i/marvin/src/log/log.cc16
1 files changed, 4 insertions, 12 deletions
diff --git a/i/marvin/src/log/log.cc b/i/marvin/src/log/log.cc
index ba5faa8..dd2227b 100644
--- a/i/marvin/src/log/log.cc
+++ b/i/marvin/src/log/log.cc
@@ -37,20 +37,12 @@ Log::Log (const char *module, const char *instance)
// Get Config
Config &config = Config::getInstance ();
// Get default level log
- level_ = toLevel (config.get<std::string>("log.level.default"));
+ std::string defaultLvl = config.get<std::string>("log.level.default",
+ "info");
+ level_ = toLevel (defaultLvl);
// Get private level if exist
- if (module)
- {
- try
- {
- level_ = toLevel (config.get<std::string>(std::string ("log.level.") + module));
- }
- catch (std::exception &)
- {
- // Do nothing if it does not exist
- }
- }
+ level_ = toLevel (config.get<std::string>(std::string ("log.level.") + module, defaultLvl));
}
/// Crée un nouveau LogMessage.