Commit a92ef813 authored by Dominik Charousset's avatar Dominik Charousset

Fix default log level and undesired log output

parent b05a4b7b
...@@ -498,8 +498,10 @@ bool operator==(const logger::field& x, const logger::field& y); ...@@ -498,8 +498,10 @@ bool operator==(const logger::field& x, const logger::field& y);
CAF_LOG_IMPL(CAF_LOG_COMPONENT, CAF_LOG_LEVEL_WARNING, output) CAF_LOG_IMPL(CAF_LOG_COMPONENT, CAF_LOG_LEVEL_WARNING, output)
#endif #endif
#define CAF_LOG_ERROR(output) \ #if CAF_LOG_LEVEL >= CAF_LOG_LEVEL_ERROR
CAF_LOG_IMPL(CAF_LOG_COMPONENT, CAF_LOG_LEVEL_ERROR, output) # define CAF_LOG_ERROR(output) \
CAF_LOG_IMPL(CAF_LOG_COMPONENT, CAF_LOG_LEVEL_ERROR, output)
#endif
#ifndef CAF_LOG_INFO #ifndef CAF_LOG_INFO
# define CAF_LOG_INFO(output) CAF_VOID_STMT # define CAF_LOG_INFO(output) CAF_VOID_STMT
......
...@@ -23,11 +23,29 @@ ...@@ -23,11 +23,29 @@
#include <limits> #include <limits>
#include <thread> #include <thread>
#include "caf/detail/build_config.hpp"
#include "caf/detail/log_level.hpp"
using std::max; using std::max;
using std::min; using std::min;
namespace { namespace {
static constexpr caf::atom_value default_log_level =
#if CAF_LOG_LEVEL == CAF_LOG_LEVEL_TRACE
caf::atom("trace");
#elif CAF_LOG_LEVEL == CAF_LOG_LEVEL_DEBUG
caf::atom("debug");
#elif CAF_LOG_LEVEL == CAF_LOG_LEVEL_INFO
caf::atom("info");
#elif CAF_LOG_LEVEL == CAF_LOG_LEVEL_WARNING
caf::atom("warning");
#elif CAF_LOG_LEVEL == CAF_LOG_LEVEL_ERROR
caf::atom("error");
#else
caf::atom("quiet");
#endif
using us_t = std::chrono::microseconds; using us_t = std::chrono::microseconds;
constexpr caf::timespan us(us_t::rep x) { constexpr caf::timespan us(us_t::rep x) {
...@@ -80,10 +98,10 @@ namespace logger { ...@@ -80,10 +98,10 @@ namespace logger {
string_view component_filter = ""; string_view component_filter = "";
const atom_value console = atom("none"); const atom_value console = atom("none");
string_view console_format = "%m"; string_view console_format = "%m";
const atom_value console_verbosity = atom("trace"); const atom_value console_verbosity = default_log_level;
string_view file_format = "%r %c %p %a %t %C %M %F:%L %m%n"; string_view file_format = "%r %c %p %a %t %C %M %F:%L %m%n";
string_view file_name = "actor_log_[PID]_[TIMESTAMP]_[NODE].log"; string_view file_name = "actor_log_[PID]_[TIMESTAMP]_[NODE].log";
const atom_value file_verbosity = atom("trace"); const atom_value file_verbosity = default_log_level;
} // namespace logger } // namespace logger
......
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