C++ logging library. It is powerful, supports asynchronous low latency, extendable, light-weight, fast performing, thread and type safe and consists of many built-in features. It provides ability to write logs in your own customized format. It also provide support for logging your classes, third-party libraries, STL and third-party containers etc.
MIT License
3.8k
stars
929
forks
source link
easylogging conf file is picked up, but level disabling ignored when using hierarchical levels #600
#include "easylogging++.h"
INITIALIZE_EASYLOGGINGPP
int main(int argv, char* argc[]) {
el::Configurations conf("easylogging.conf");
el::Loggers::reconfigureAllLoggers(conf);
el::Loggers::addFlag(el::LoggingFlag::HierarchicalLogging);
LOG(TRACE) << "My first TRACE log using default logger with conf file";
LOG(DEBUG) << "My first DEBUG log using default logger with conf file";
// LOG(FATAL) << "My first FATAL log using default logger with conf file"; // terminates app
LOG(ERROR) << "My first ERROR log using default logger with conf file";
LOG(WARNING) << "My first WARNING log using default logger with conf file";
LOG(INFO) << "My first INFO log using default logger with conf file";
return 0;
}
07/01 int main(int, char **) My first TRACE log using default logger with conf file
2018-01-07 15:31:54,926377 My first DEBUG log using default logger with conf file
2018-01-07 15:31:54,926391 My first ERROR log using default logger with conf file
2018-01-07 15:31:54,926403 My first WARNING log using default logger with conf file
2018-01-07 15:31:54,926413 My first INFO log using default logger with conf file
I've renamed the easylogging.conf and got an error that it wasn't picked up, so easylogging reads my conf file. Also, TRACE is formatted differently as specified in the conf-file.
But all output is generated even though all ENABLED configuration values are false. When I remove the statement setting the hierarchical logging flag, things seem to work. I wonder how to properly work with the hierarchical setting. In my understanding, enabling TRACE would enable all other levels, while setting a more severe level would only enable that and the more severe levels.
Thank you
I have the same problem. Probably just a misunderstanding of the documentation. Anyway, I don't know what I have to do... Someone for lighting me ? A link ? A sample ? Thanks
The cpp source:
the easylogging.conf:
the output I get:
I've renamed the
easylogging.conf
and got an error that it wasn't picked up, so easylogging reads my conf file. Also,TRACE
is formatted differently as specified in the conf-file.But all output is generated even though all
ENABLED
configuration values arefalse
. When I remove the statement setting the hierarchical logging flag, things seem to work. I wonder how to properly work with the hierarchical setting. In my understanding, enablingTRACE
would enable all other levels, while setting a more severe level would only enable that and the more severe levels. Thank you