Commit eb2a9810 authored by Dominik Charousset's avatar Dominik Charousset

Fix bug with setting log verbosity to quiet

parent de5ab58f
...@@ -297,6 +297,7 @@ bool operator==(const logger::field& x, const logger::field& y); ...@@ -297,6 +297,7 @@ bool operator==(const logger::field& x, const logger::field& y);
#define CAF_CAT(a, b) a##b #define CAF_CAT(a, b) a##b
#define CAF_LOG_LEVEL_QUIET -1
#define CAF_LOG_LEVEL_ERROR 0 #define CAF_LOG_LEVEL_ERROR 0
#define CAF_LOG_LEVEL_WARNING 1 #define CAF_LOG_LEVEL_WARNING 1
#define CAF_LOG_LEVEL_INFO 2 #define CAF_LOG_LEVEL_INFO 2
......
...@@ -188,6 +188,8 @@ bool logger::accepts(int level, const char* cname_begin, ...@@ -188,6 +188,8 @@ bool logger::accepts(int level, const char* cname_begin,
const char* cname_end) { const char* cname_end) {
CAF_ASSERT(cname_begin != nullptr && cname_end != nullptr); CAF_ASSERT(cname_begin != nullptr && cname_end != nullptr);
CAF_ASSERT(level >= 0 && level <= 4); CAF_ASSERT(level >= 0 && level <= 4);
if (level > level_)
return false;
auto& filter = system_.config().logger_component_filter; auto& filter = system_.config().logger_component_filter;
if (!filter.empty()) { if (!filter.empty()) {
auto it = std::search(filter.begin(), filter.end(), cname_begin, cname_end); auto it = std::search(filter.begin(), filter.end(), cname_begin, cname_end);
...@@ -214,6 +216,10 @@ void logger::init(actor_system_config& cfg) { ...@@ -214,6 +216,10 @@ void logger::init(actor_system_config& cfg) {
inline_output_ = cfg.logger_inline_output; inline_output_ = cfg.logger_inline_output;
// Parse the configured log level. // Parse the configured log level.
switch (static_cast<uint64_t>(cfg.logger_verbosity)) { switch (static_cast<uint64_t>(cfg.logger_verbosity)) {
case atom_uint("quiet"):
case atom_uint("QUIET"):
level_ = CAF_LOG_LEVEL_QUIET;
break;
case atom_uint("error"): case atom_uint("error"):
case atom_uint("ERROR"): case atom_uint("ERROR"):
level_ = CAF_LOG_LEVEL_ERROR; level_ = CAF_LOG_LEVEL_ERROR;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment