log: remove utility values from level_t enum

This commit is contained in:
Danny Robson 2016-01-21 13:55:08 +11:00
parent b107666376
commit 9f6d41eb8c
2 changed files with 5 additions and 6 deletions

View File

@ -85,12 +85,12 @@ log_level (void)
{ {
const char *env = getenv ("LOG_LEVEL"); const char *env = getenv ("LOG_LEVEL");
if (!env) if (!env)
return util::DEFAULT; return util::DEFAULT_LOG_LEVEL;
try { try {
return to_level (env); return to_level (env);
} catch (...) { } catch (...) {
return util::DEFAULT; return util::DEFAULT_LOG_LEVEL;
} }
} }

View File

@ -42,12 +42,11 @@ namespace util {
NOTICE, /** normal but significant condition */ NOTICE, /** normal but significant condition */
INFORMATIONAL, INFORMATIONAL,
INFO = INFORMATIONAL, /** informational messages */ INFO = INFORMATIONAL, /** informational messages */
DEBUG, /** debug-level messages */ DEBUG /** debug-level messages */
NUM_LEVELS,
DEFAULT = INFO
}; };
constexpr auto DEFAULT_LOG_LEVEL = INFO;
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
std::ostream& std::ostream&
operator<< (std::ostream&, level_t); operator<< (std::ostream&, level_t);