33 el::Configurations conf = *el::Loggers::defaultConfigurations();
35 conf.setGlobally(el::ConfigurationType::Enabled,
"true");
36 conf.setGlobally(el::ConfigurationType::Format,
"%datetime{%Y-%M-%d %H:%m:%s} %tick %level %msg");
37 conf.setGlobally(el::ConfigurationType::ToFile,
"false");
38 conf.setGlobally(el::ConfigurationType::ToStandardOutput,
"true");
39 conf.setGlobally(el::ConfigurationType::SubsecondPrecision,
"2");
40 conf.setGlobally(el::ConfigurationType::PerformanceTracking,
"false");
41 conf.setGlobally(el::ConfigurationType::MaxLogFileSize,
"2097152");
42 conf.setGlobally(el::ConfigurationType::LogFlushThreshold,
"0");
43 conf.set(el::Level::Verbose, el::ConfigurationType::Format,
"%datetime{%Y-%M-%d %H:%m:%s} %tick %msg");
45 el::Loggers::addFlag(el::LoggingFlag::DisableApplicationAbortOnFatalLog);
46 el::Loggers::addFlag(el::LoggingFlag::DisablePerformanceTrackingCheckpointComparison);
47 el::Loggers::addFlag(el::LoggingFlag::ColoredTerminalOutput);
48 el::Loggers::removeFlag(el::LoggingFlag::AllowVerboseIfModuleNotSpecified);
50 el::Loggers::setDefaultConfigurations(conf,
true);
63 el::Configurations conf = *el::Loggers::defaultConfigurations();
65 conf.set(el::Level::Trace, el::ConfigurationType::Enabled,
"false");
66 conf.set(el::Level::Debug, el::ConfigurationType::Enabled,
"false");
67 conf.set(el::Level::Info, el::ConfigurationType::Enabled,
"false");
68 conf.set(el::Level::Warning, el::ConfigurationType::Enabled,
"false");
69 conf.set(el::Level::Error, el::ConfigurationType::Enabled,
"false");
70 conf.set(el::Level::Fatal, el::ConfigurationType::Enabled,
"false");
74 conf.set(el::Level::Trace, el::ConfigurationType::Enabled,
"true");
77 conf.set(el::Level::Debug, el::ConfigurationType::Enabled,
"true");
80 conf.set(el::Level::Info, el::ConfigurationType::Enabled,
"true");
83 conf.set(el::Level::Warning, el::ConfigurationType::Enabled,
"true");
86 conf.set(el::Level::Error, el::ConfigurationType::Enabled,
"true");
89 conf.set(el::Level::Fatal, el::ConfigurationType::Enabled,
"true");
96 el::Loggers::setDefaultConfigurations(conf,
true);
105 void Logger::logToFile(
const std::string& logFile) {
106 el::Configurations conf = *el::Loggers::defaultConfigurations();
108 conf.setGlobally(el::ConfigurationType::Filename, logFile);
109 conf.setGlobally(el::ConfigurationType::ToFile,
"true");
111 el::Loggers::setDefaultConfigurations(conf,
true);