From 29bf22f324780de4fa7cd79470df5721f5d28010 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Sat, 18 Oct 2014 00:32:37 +0200 Subject: [PATCH] Fix: Don't use VT100 color codes in log files refs #7396 --- lib/base/console.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/base/console.cpp b/lib/base/console.cpp index 75b1d9f1f..ad47aa3c5 100644 --- a/lib/base/console.cpp +++ b/lib/base/console.cpp @@ -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); } @@ -218,4 +216,4 @@ void Console::SetWindowsConsoleColor(std::ostream& fp, int color) SetConsoleTextAttribute(hConsole, attrs); } -#endif /* _WIN32 */ \ No newline at end of file +#endif /* _WIN32 */