log: remove utility values from level_t enum
This commit is contained in:
parent
b107666376
commit
9f6d41eb8c
4
log.cpp
4
log.cpp
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
7
log.hpp
7
log.hpp
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user