aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/common/logging/text_formatter.cpp
diff options
context:
space:
mode:
authorGravatar bunnei <bunneidev@gmail.com>2015-08-05 11:59:06 -0400
committerGravatar bunnei <bunneidev@gmail.com>2015-08-05 11:59:06 -0400
commitb6c241d667dd6a22b1dadaf9c2d6ddaac2e93de5 (patch)
tree509244f0525c8b1a304134d7c33a631cec0f95d3 /src/common/logging/text_formatter.cpp
parentbd6131bdc02aef73214cf5dd5c7f5e1ee705f79a (diff)
parent0298b7bedd17f88430486dd502fb7923b1d10f26 (diff)
Merge pull request #1018 from bbarenblat/master
Handle invalid `Log::Level::Count`
Diffstat (limited to 'src/common/logging/text_formatter.cpp')
-rw-r--r--src/common/logging/text_formatter.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/common/logging/text_formatter.cpp b/src/common/logging/text_formatter.cpp
index 94f3dfc1..de195b0f 100644
--- a/src/common/logging/text_formatter.cpp
+++ b/src/common/logging/text_formatter.cpp
@@ -14,6 +14,7 @@
#include "common/logging/log.h"
#include "common/logging/text_formatter.h"
+#include "common/assert.h"
#include "common/common_funcs.h"
#include "common/string_util.h"
@@ -82,6 +83,8 @@ void PrintColoredMessage(const Entry& entry) {
color = FOREGROUND_RED | FOREGROUND_INTENSITY; break;
case Level::Critical: // Bright magenta
color = FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_INTENSITY; break;
+ case Level::Count:
+ UNREACHABLE();
}
SetConsoleTextAttribute(console_handle, color);
@@ -101,6 +104,8 @@ void PrintColoredMessage(const Entry& entry) {
color = ESC "[1;31m"; break;
case Level::Critical: // Bright magenta
color = ESC "[1;35m"; break;
+ case Level::Count:
+ UNREACHABLE();
}
fputs(color, stderr);