C++ logging library. It is extremely powerful, 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.75k
stars
918
forks
source link
performance logging TIMED_SCOPE(timerBlkObj) to a file #839
#include "easylogging++.h"
#include <chrono>
#include <thread>
using namespace std::chrono_literals;
INITIALIZE_EASYLOGGINGPP
int main() {
el::Loggers::addFlag(el::LoggingFlag::MultiLoggerSupport);
el::Loggers::configureFromGlobal("./easylogging++.conf");
for (int i = 0; i <= 50; ++i) {
TIMED_SCOPE(timerBlkObj, "a1"); // this need to go to a1.txt and to console
std::this_thread::sleep_for(10ms);
}
return 0;
}
could someone provide example how to put all performance logging into a file
a1.txt
?looks like this example is doing something different and more complicated: https://github.com/abumq/easyloggingpp/blob/master/samples/STL/custom-performance-output.cpp I have not understood how to use that.
This code output performance to console, how to make it output to second logger (--a1) ?
easylogging++.conf
main.cpp