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");
if (!env)
return util::DEFAULT;
return util::DEFAULT_LOG_LEVEL;
try {
return to_level (env);
} catch (...) {
return util::DEFAULT;
return util::DEFAULT_LOG_LEVEL;
}
}

View File

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