Fix some mistakes in ANSI escape codes
This commit is contained in:
parent
e3310792d3
commit
d6361e1cfd
|
@ -65,13 +65,13 @@ std::ostream &operator<<(std::ostream &stream, Phrases phrase)
|
||||||
setStyle(stream, TextAttribute::Bold);
|
setStyle(stream, TextAttribute::Bold);
|
||||||
break;
|
break;
|
||||||
case Phrases::ErrorMessage:
|
case Phrases::ErrorMessage:
|
||||||
setStyle(stream, Color::Green, ColorContext::Foreground, TextAttribute::Bold);
|
setStyle(stream, Color::Red, ColorContext::Foreground, TextAttribute::Bold);
|
||||||
stream << "==> ERROR: ";
|
stream << "==> ERROR: ";
|
||||||
setStyle(stream, TextAttribute::Reset);
|
setStyle(stream, TextAttribute::Reset);
|
||||||
setStyle(stream, TextAttribute::Bold);
|
setStyle(stream, TextAttribute::Bold);
|
||||||
break;
|
break;
|
||||||
case Phrases::WarningMessage:
|
case Phrases::WarningMessage:
|
||||||
setStyle(stream, Color::Green, ColorContext::Foreground, TextAttribute::Bold);
|
setStyle(stream, Color::Yellow, ColorContext::Foreground, TextAttribute::Bold);
|
||||||
stream << "==> WARNING: ";
|
stream << "==> WARNING: ";
|
||||||
setStyle(stream, TextAttribute::Reset);
|
setStyle(stream, TextAttribute::Reset);
|
||||||
setStyle(stream, TextAttribute::Bold);
|
setStyle(stream, TextAttribute::Bold);
|
||||||
|
|
|
@ -46,7 +46,7 @@ inline void setStyle(std::ostream &stream, Color foregroundColor, Color backgrou
|
||||||
{
|
{
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
stream << '\e' << '[' << static_cast<char>(displayAttribute) << ';' << static_cast<char>(ColorContext::Foreground)
|
stream << '\e' << '[' << static_cast<char>(displayAttribute) << ';' << static_cast<char>(ColorContext::Foreground)
|
||||||
<< static_cast<char>(foregroundColor) << ';' << static_cast<char>(ColorContext::Foreground) << static_cast<char>(backgroundColor)
|
<< static_cast<char>(foregroundColor) << ';' << static_cast<char>(ColorContext::Background) << static_cast<char>(backgroundColor)
|
||||||
<< 'm';
|
<< 'm';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue