summaryrefslogtreecommitdiff
path: root/i/marvin/src/log
diff options
context:
space:
mode:
authordufourj2006-03-13 20:32:08 +0000
committerdufourj2006-03-13 20:32:08 +0000
commitbf8ce965b3f09ee38a4ab30c14f0c55abe9f0abe (patch)
tree323befd2989619e718097f79d6c940d46e4fd0a7 /i/marvin/src/log
parent4d1aa4568413c4266375dc26bde0cb3d57dbe01c (diff)
Config :
- getter avec valeur par défaut. Log : - plus besoin de try ; - valeur par défaut du niveau de log en dure (plus besoin de la mettre dans config).
Diffstat (limited to 'i/marvin/src/log')
-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.