55 el::Configurations conf = *el::Loggers::defaultConfigurations();
57 conf.setGlobally(el::ConfigurationType::Enabled,
"true");
58 conf.setGlobally(el::ConfigurationType::Format,
"%datetime{%Y-%M-%d %H:%m:%s} %tick %level %msg");
59 conf.setGlobally(el::ConfigurationType::ToFile,
"false");
60 conf.setGlobally(el::ConfigurationType::ToStandardOutput,
"true");
61 conf.setGlobally(el::ConfigurationType::SubsecondPrecision,
"2");
62 conf.setGlobally(el::ConfigurationType::PerformanceTracking,
"false");
63 conf.setGlobally(el::ConfigurationType::MaxLogFileSize,
"2097152");
64 conf.setGlobally(el::ConfigurationType::LogFlushThreshold,
"0");
65 conf.set(el::Level::Verbose, el::ConfigurationType::Format,
"%datetime{%Y-%M-%d %H:%m:%s} %tick %msg");
67 el::Loggers::addFlag(el::LoggingFlag::DisableApplicationAbortOnFatalLog);
68 el::Loggers::addFlag(el::LoggingFlag::DisablePerformanceTrackingCheckpointComparison);
69 el::Loggers::addFlag(el::LoggingFlag::ColoredTerminalOutput);
70 el::Loggers::removeFlag(el::LoggingFlag::AllowVerboseIfModuleNotSpecified);
72 el::Loggers::setDefaultConfigurations(conf,
true);
84 void Logger::setLogLevel(
int level) {
85 el::Configurations conf = *el::Loggers::defaultConfigurations();
87 conf.set(el::Level::Trace, el::ConfigurationType::Enabled,
"false");
88 conf.set(el::Level::Debug, el::ConfigurationType::Enabled,
"false");
89 conf.set(el::Level::Info, el::ConfigurationType::Enabled,
"false");
90 conf.set(el::Level::Warning, el::ConfigurationType::Enabled,
"false");
91 conf.set(el::Level::Error, el::ConfigurationType::Enabled,
"false");
92 conf.set(el::Level::Fatal, el::ConfigurationType::Enabled,
"false");
96 conf.set(el::Level::Trace, el::ConfigurationType::Enabled,
"true");
99 conf.set(el::Level::Debug, el::ConfigurationType::Enabled,
"true");
102 conf.set(el::Level::Info, el::ConfigurationType::Enabled,
"true");
105 conf.set(el::Level::Warning, el::ConfigurationType::Enabled,
"true");
108 conf.set(el::Level::Error, el::ConfigurationType::Enabled,
"true");
111 conf.set(el::Level::Fatal, el::ConfigurationType::Enabled,
"true");
118 el::Loggers::setDefaultConfigurations(conf,
true);
127 void Logger::logToFile(
const std::string& logFile) {
128 el::Configurations conf = *el::Loggers::defaultConfigurations();
130 conf.setGlobally(el::ConfigurationType::Filename, logFile);
131 conf.setGlobally(el::ConfigurationType::ToFile,
"true");
133 el::Loggers::setDefaultConfigurations(conf,
true);