Fix some mistakes in ANSI escape codes

improve/error-messages
Martchus 5 years ago
parent e3310792d3
commit d6361e1cfd
  1. 4
      io/ansiescapecodes.cpp
  2. 2
      io/ansiescapecodes.h

@ -65,13 +65,13 @@ std::ostream &operator<<(std::ostream &stream, Phrases phrase)
setStyle(stream, TextAttribute::Bold);
break;
case Phrases::ErrorMessage:
setStyle(stream, Color::Green, ColorContext::Foreground, TextAttribute::Bold);
setStyle(stream, Color::Red, ColorContext::Foreground, TextAttribute::Bold);
stream << "==> ERROR: ";
setStyle(stream, TextAttribute::Reset);
setStyle(stream, TextAttribute::Bold);
break;
case Phrases::WarningMessage:
setStyle(stream, Color::Green, ColorContext::Foreground, TextAttribute::Bold);
setStyle(stream, Color::Yellow, ColorContext::Foreground, TextAttribute::Bold);
stream << "==> WARNING: ";
setStyle(stream, TextAttribute::Reset);
setStyle(stream, TextAttribute::Bold);

@ -46,7 +46,7 @@ inline void setStyle(std::ostream &stream, Color foregroundColor, Color backgrou
{
if (enabled) {
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';
}
}

Loading…
Cancel
Save