Commit 20f3e5f6 authored by Dominik Charousset's avatar Dominik Charousset

Prevent log level from being set accidently

parent 65f21491
......@@ -159,7 +159,6 @@ inline caf::actor_id caf_set_aid_dummy() { return 0; }
#define CAF_PUSH_AID(unused) static_cast<void>(0)
#define CAF_PUSH_AID_FROM_PTR(unused) static_cast<void>(0)
#define CAF_SET_AID(unused) caf_set_aid_dummy()
#define CAF_LOG_LEVEL 1
#else
#define CAF_LOG_IMPL(lvlname, classname, funname, message) \
if (strcmp(lvlname, "ERROR") == 0) { \
......
......@@ -65,6 +65,12 @@ struct log_event {
};
#ifndef CAF_LOG_LEVEL
constexpr int global_log_level = 0;
#else
constexpr int global_log_level = CAF_LOG_LEVEL;
#endif
class logging_impl : public logging {
public:
......@@ -74,7 +80,7 @@ class logging_impl : public logging {
"DEBUG", "TRACE"};
m_thread = std::thread([this] { (*this)(); });
std::string msg = "ENTRY log level = ";
msg += log_level_lookup_table[CAF_LOG_LEVEL];
msg += log_level_lookup_table[global_log_level];
log("TRACE", "logging", "run", __FILE__, __LINE__, msg);
}
......
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