]> granicus.if.org Git - icinga2/commitdiff
Fix: Don't use VT100 color codes in log files
authorGunnar Beutner <gunnar@beutner.name>
Fri, 17 Oct 2014 22:32:37 +0000 (00:32 +0200)
committerGunnar Beutner <gunnar@beutner.name>
Fri, 17 Oct 2014 22:34:15 +0000 (00:34 +0200)
refs #7396

lib/base/console.cpp

index 75b1d9f1f10e40504498fdbb61e302c6f8a24d24..ad47aa3c5794a310a2a1e2cbea30650285a6dfca 100644 (file)
@@ -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 */