encfs/vendor/github.com/muflihun/easyloggingpp/samples/async/prog.cpp
Valient Gough 5f0806c5cc Add "easylogging" from "https://github.com/muflihun/easyloggingpp@master"
git-vendor-name: easylogging
git-vendor-dir: vendor/github.com/muflihun/easyloggingpp
git-vendor-repository: https://github.com/muflihun/easyloggingpp
git-vendor-ref: master
2017-08-05 23:23:41 -07:00

29 lines
990 B
C++

#include "easylogging++.h"
#include "mymath.h"
INITIALIZE_EASYLOGGINGPP
TIMED_SCOPE(benchmark, "benchmark-program");
int main(int argc, char *argv[])
{
// ELPP_INITIALIZE_SYSLOG("my_proc", LOG_PID | LOG_CONS | LOG_PERROR, LOG_USER);
el::Loggers::reconfigureAllLoggers(el::ConfigurationType::ToStandardOutput, "false");
TIMED_BLOCK(loggingPerformance, "benchmark-block") {
el::base::SubsecondPrecision ssPrec(3);
std::cout << "Starting program " << el::base::utils::DateTime::getDateTime("%h:%m:%s", &ssPrec) << std::endl;
int MAX_LOOP = 1000000;
for (int i = 0; i <= MAX_LOOP; ++i) {
LOG(INFO) << "Log message " << i;
}
int result = MyMath::sum(1, 2);
result = MyMath::sum(1, 3);
std::cout << "Finished program - cleaning! " << el::base::utils::DateTime::getDateTime("%h:%m:%s", &ssPrec) << std::endl;
}
// SYSLOG(INFO) << "This is syslog - read it from /var/log/syslog";
return 0;
}