@@ -52,6 +52,21 @@ struct OUT
5252 static const string reset;
5353};
5454
55+ #ifdef NO_COLOR
56+ const string OUT::black = " " ;
57+ const string OUT::red = " " ;
58+ const string OUT::green = " " ;
59+ const string OUT::yellow = " " ;
60+ const string OUT::blue = " " ;
61+ const string OUT::magenta = " " ;
62+ const string OUT::cyan = " " ;
63+ const string OUT::white = " " ;
64+
65+ const string OUT::bold = " " ;
66+ const string OUT::underline = " " ;
67+
68+ const string OUT::reset = " " ;
69+ #else
5570const string OUT::black = " \033 [30m" ;
5671const string OUT::red = " \033 [31m" ;
5772const string OUT::green = " \033 [32m" ;
@@ -65,7 +80,7 @@ const string OUT::bold = "\033[1m";
6580const string OUT::underline = " \033 [4m" ;
6681
6782const string OUT::reset = " \033 [0m" ;
68-
83+ # endif
6984
7085// enable easy logging of STL containers
7186#define ELPP_STL_LOGGING
@@ -325,7 +340,11 @@ namespace pfasst
325340 {
326341 el::Loggers::addFlag (el::LoggingFlag::LogDetailedCrashReason);
327342 el::Loggers::addFlag (el::LoggingFlag::DisableApplicationAbortOnFatalLog);
343+ #ifdef NO_COLOR
344+ el::Loggers::removeFlag (el::LoggingFlag::ColoredTerminalOutput);
345+ #else
328346 el::Loggers::addFlag (el::LoggingFlag::ColoredTerminalOutput);
347+ #endif
329348 el::Loggers::addFlag (el::LoggingFlag::MultiLoggerSupport);
330349 el::Loggers::addFlag (el::LoggingFlag::CreateLoggerAutomatically);
331350 }
0 commit comments