From 9b7702195a060cb746c6f61c3c8b85b85d8eb467 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Mon, 12 May 2014 10:27:01 +0200 Subject: [PATCH] Don't use colors for the whole log message. Refs #6070 --- lib/base/streamlogger.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/base/streamlogger.cpp b/lib/base/streamlogger.cpp index 5731d0602..01d214d97 100644 --- a/lib/base/streamlogger.cpp +++ b/lib/base/streamlogger.cpp @@ -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"; } /**