Merge pull request #5628 from wangyoucao577/feature/disable-debug-log-compile-time-control

Control release mode debug logging output by ENABLE_DEBUG_LOGGING option
This commit is contained in:
Denis Chapligin
2020-08-11 10:27:27 +03:00
committed by GitHub
3 changed files with 11 additions and 3 deletions
+3 -3
View File
@@ -16,7 +16,7 @@ namespace
static const char COL_RESET[]{"\x1b[0m"};
static const char RED[]{"\x1b[31m"};
static const char YELLOW[]{"\x1b[33m"};
#ifndef NDEBUG
#ifdef ENABLE_DEBUG_LOGGING
static const char MAGENTA[]{"\x1b[35m"};
#endif
// static const char GREEN[] { "\x1b[32m"};
@@ -80,7 +80,7 @@ Log::Log(LogLevel level_, std::ostream &ostream) : level(level_), stream(ostream
stream << (is_terminal ? RED : "") << "[error] ";
break;
case logDEBUG:
#ifndef NDEBUG
#ifdef ENABLE_DEBUG_LOGGING
stream << (is_terminal ? MAGENTA : "") << "[debug] ";
#endif
break;
@@ -126,7 +126,7 @@ Log::~Log()
std::cerr << std::endl;
break;
case logDEBUG:
#ifdef NDEBUG
#ifndef ENABLE_DEBUG_LOGGING
break;
#endif
case logINFO: