diff options
| author | 2015-08-05 11:59:06 -0400 | |
|---|---|---|
| committer | 2015-08-05 11:59:06 -0400 | |
| commit | b6c241d667dd6a22b1dadaf9c2d6ddaac2e93de5 (patch) | |
| tree | 509244f0525c8b1a304134d7c33a631cec0f95d3 /src/common/logging/text_formatter.cpp | |
| parent | Merge pull request #1015 from yuriks/vertex-caching (diff) | |
| parent | Use UNREACHABLE macro for impossible cases in previous commit (diff) | |
| download | yuzu-b6c241d667dd6a22b1dadaf9c2d6ddaac2e93de5.tar.gz yuzu-b6c241d667dd6a22b1dadaf9c2d6ddaac2e93de5.tar.xz yuzu-b6c241d667dd6a22b1dadaf9c2d6ddaac2e93de5.zip | |
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.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/common/logging/text_formatter.cpp b/src/common/logging/text_formatter.cpp index 94f3dfc1f..de195b0f7 100644 --- a/src/common/logging/text_formatter.cpp +++ b/src/common/logging/text_formatter.cpp | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include "common/logging/log.h" | 14 | #include "common/logging/log.h" |
| 15 | #include "common/logging/text_formatter.h" | 15 | #include "common/logging/text_formatter.h" |
| 16 | 16 | ||
| 17 | #include "common/assert.h" | ||
| 17 | #include "common/common_funcs.h" | 18 | #include "common/common_funcs.h" |
| 18 | #include "common/string_util.h" | 19 | #include "common/string_util.h" |
| 19 | 20 | ||
| @@ -82,6 +83,8 @@ void PrintColoredMessage(const Entry& entry) { | |||
| 82 | color = FOREGROUND_RED | FOREGROUND_INTENSITY; break; | 83 | color = FOREGROUND_RED | FOREGROUND_INTENSITY; break; |
| 83 | case Level::Critical: // Bright magenta | 84 | case Level::Critical: // Bright magenta |
| 84 | color = FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_INTENSITY; break; | 85 | color = FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_INTENSITY; break; |
| 86 | case Level::Count: | ||
| 87 | UNREACHABLE(); | ||
| 85 | } | 88 | } |
| 86 | 89 | ||
| 87 | SetConsoleTextAttribute(console_handle, color); | 90 | SetConsoleTextAttribute(console_handle, color); |
| @@ -101,6 +104,8 @@ void PrintColoredMessage(const Entry& entry) { | |||
| 101 | color = ESC "[1;31m"; break; | 104 | color = ESC "[1;31m"; break; |
| 102 | case Level::Critical: // Bright magenta | 105 | case Level::Critical: // Bright magenta |
| 103 | color = ESC "[1;35m"; break; | 106 | color = ESC "[1;35m"; break; |
| 107 | case Level::Count: | ||
| 108 | UNREACHABLE(); | ||
| 104 | } | 109 | } |
| 105 | 110 | ||
| 106 | fputs(color, stderr); | 111 | fputs(color, stderr); |