Skip to content

Commit 36d3407

Browse files
committed
Revert "chore: remove compile time debug log control"
This reverts commit 1ada466.
1 parent 11b0a2e commit 36d3407

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/util/log.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ namespace
1616
static const char COL_RESET[]{"\x1b[0m"};
1717
static const char RED[]{"\x1b[31m"};
1818
static const char YELLOW[]{"\x1b[33m"};
19+
#ifndef NDEBUG
1920
static const char MAGENTA[]{"\x1b[35m"};
21+
#endif
2022
// static const char GREEN[] { "\x1b[32m"};
2123
// static const char BLUE[] { "\x1b[34m"};
2224
// static const char CYAN[] { "\x1b[36m"};
@@ -78,7 +80,9 @@ Log::Log(LogLevel level_, std::ostream &ostream) : level(level_), stream(ostream
7880
stream << (is_terminal ? RED : "") << "[error] ";
7981
break;
8082
case logDEBUG:
83+
#ifndef NDEBUG
8184
stream << (is_terminal ? MAGENTA : "") << "[debug] ";
85+
#endif
8286
break;
8387
default: // logINFO:
8488
stream << "[info] ";
@@ -122,6 +126,9 @@ Log::~Log()
122126
std::cerr << std::endl;
123127
break;
124128
case logDEBUG:
129+
#ifdef NDEBUG
130+
break;
131+
#endif
125132
case logINFO:
126133
default:
127134
std::cout << buffer.str();

0 commit comments

Comments
 (0)