Skip to content

Commit

Permalink
Fix: Don't use VT100 color codes in log files
Browse files Browse the repository at this point in the history
refs #7396
  • Loading branch information
gunnarbeutner authored and TheFlyingCorpse committed Oct 19, 2014
1 parent d5b877f commit 7dcfee5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/base/console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,11 @@ ConsoleColorTag::ConsoleColorTag(int color)

std::ostream& icinga::operator<<(std::ostream& fp, const ConsoleColorTag& cct)
{
fp.flush();

#ifndef _WIN32
if (l_ConsoleType == Console_VT100)
if (Console::GetType(fp) == Console_VT100)
Console::PrintVT100ColorCode(fp, cct.m_Color);
#else /* _WIN32 */
if (l_ConsoleType == Console_Windows) {
if (Console::GetType(fp) == Console_Windows) {
fp.flush();
Console::SetWindowsConsoleColor(fp, cct.m_Color);
}
Expand Down Expand Up @@ -218,4 +216,4 @@ void Console::SetWindowsConsoleColor(std::ostream& fp, int color)

SetConsoleTextAttribute(hConsole, attrs);
}
#endif /* _WIN32 */
#endif /* _WIN32 */

0 comments on commit 7dcfee5

Please sign in to comment.