Commit 35312df9 authored by Orvid King's avatar Orvid King Committed by Facebook Github Bot

Escape the escape sequences in CustomLogFormatter

Summary: These need to be escaped (they also don't work on Windows)

Reviewed By: yfeldblum

Differential Revision: D9566079

fbshipit-source-id: a202673c7cea62f3534ceff9cb81ee84aca65049
parent 8a710957
......@@ -42,7 +42,7 @@ StringPiece getGlogLevelName(LogLevel level) {
StringPiece getResetSequence(LogLevel level) {
if (level >= LogLevel::INFO && level < LogLevel::WARN) {
return "\e[0m";
return "\033[0m";
} else {
return "";
}
......@@ -50,15 +50,15 @@ StringPiece getResetSequence(LogLevel level) {
StringPiece getColorSequence(LogLevel level) {
if (level < LogLevel::INFO) {
return "\e[1;30m"; // BOLD/BRIGHT BLACK ~ GREY
return "\033[1;30m"; // BOLD/BRIGHT BLACK ~ GREY
} else if (level < LogLevel::WARN) {
return ""; // NO COLOR
} else if (level < LogLevel::ERR) {
return "\e[33m"; // YELLOW
return "\033[33m"; // YELLOW
} else if (level < LogLevel::CRITICAL) {
return "\e[31m"; // RED
return "\033[31m"; // RED
}
return "\e[1;41m"; // BOLD ON RED BACKGROUND
return "\033[1;41m"; // BOLD ON RED BACKGROUND
}
struct FormatKeys {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment