encfs/vendor/github.com/muflihun/easyloggingpp/samples/STL/all-logs.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

63 lines
1.5 KiB
C++

//
// This file is part of Easylogging++ samples
//
// Writes all logs (incl. debug version of logs i.e, DLOG etc) using default logger
// We add logging flag `DisableApplicationAbortOnFatalLog` that prevents application abort on FATAL log
//
// Revision 1.2
// @author mkhan3189
//
#include "easylogging++.h"
INITIALIZE_EASYLOGGINGPP
int main(int argc, char** argv) {
START_EASYLOGGINGPP(argc, argv);
el::Loggers::addFlag(el::LoggingFlag::DisableApplicationAbortOnFatalLog);
el::Loggers::addFlag(el::LoggingFlag::ColoredTerminalOutput);
// You can uncomment following lines to take advantage of hierarchical logging
// el::Loggers::addFlag(el::LoggingFlag::HierarchicalLogging);
// el::Loggers::setLoggingLevel(el::Level::Global);
LOG(INFO);
LOG(DEBUG);
LOG(WARNING);
LOG(ERROR);
LOG(TRACE);
VLOG(1);
LOG(FATAL);
DLOG(INFO);
DLOG(DEBUG);
DLOG(WARNING);
DLOG(ERROR);
DLOG(TRACE);
DVLOG(1);
DLOG(FATAL);
LOG(INFO) << "Turning off colored output";
el::Loggers::removeFlag(el::LoggingFlag::ColoredTerminalOutput);
LOG_IF(true, INFO);
LOG_IF(true, DEBUG);
LOG_IF(true, WARNING);
LOG_IF(true, ERROR);
LOG_IF(true, TRACE);
VLOG_IF(true, 1);
LOG_IF(true, FATAL);
LOG_EVERY_N(1, INFO);
LOG_EVERY_N(1, DEBUG);
LOG_EVERY_N(1, WARNING);
LOG_EVERY_N(1, ERROR);
LOG_EVERY_N(1, TRACE);
VLOG_EVERY_N(1, 1);
LOG_EVERY_N(1, FATAL);
CHECK(1 == 1);
CCHECK(1 == 1, "default");
return 0;
}