]> granicus.if.org Git - icinga2/commitdiff
Don't use colors for the whole log message.
authorGunnar Beutner <gunnar.beutner@netways.de>
Mon, 12 May 2014 08:27:01 +0000 (10:27 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Mon, 12 May 2014 08:27:01 +0000 (10:27 +0200)
Refs #6070

lib/base/streamlogger.cpp

index 5731d06029cd0e63702373f2bbf937cecfd7ce70..01d214d972c6549ce59516e818323f297a272022 100644 (file)
@@ -90,6 +90,8 @@ void StreamLogger::ProcessLogEntry(std::ostream& stream, bool tty, const LogEntr
 
        boost::mutex::scoped_lock lock(m_Mutex);
 
+       stream << "[" << timestamp << "] <" << Utility::GetThreadName() << "> ";
+
        if (tty) {
                switch (entry.Severity) {
                        case LogWarning:
@@ -103,14 +105,12 @@ void StreamLogger::ProcessLogEntry(std::ostream& stream, bool tty, const LogEntr
                }
        }
 
-       stream << "[" << timestamp << "] <" << Utility::GetThreadName() << "> "
-                << Logger::SeverityToString(entry.Severity) << "/" << entry.Facility << ": "
-                << entry.Message;
+       stream << Logger::SeverityToString(entry.Severity);
 
        if (tty)
                stream << "\x1b[0m"; // clear colors
 
-       stream << "\n";
+       stream << "/" << entry.Facility << ": " << entry.Message << "\n";
 }
 
 /**