[Libreoffice-commits] online.git: loolwsd/Util.cpp
Ashod Nakashian
ashod.nakashian at collabora.co.uk
Wed Mar 9 02:33:06 UTC 2016
loolwsd/Util.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
New commits:
commit 18a224b4135457ca59cb17c962ccb9c8c8e7c510
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date: Tue Mar 8 19:19:41 2016 -0500
loolwsd: Color logs can be enabled by defining LOOL_LOGCOLOR envar
Change-Id: I12a38562f05c5d0b5d1c970a4b67240167322daf
Reviewed-on: https://gerrit.libreoffice.org/23051
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
diff --git a/loolwsd/Util.cpp b/loolwsd/Util.cpp
index e4d1352..ee7aaca 100644
--- a/loolwsd/Util.cpp
+++ b/loolwsd/Util.cpp
@@ -115,7 +115,10 @@ namespace Log
<< std::setw(5) << std::setfill('0') << Poco::Process::id();
SourceId = oss.str();
- auto& logger = Poco::Logger::create(SourceName, new Poco::ConsoleChannel(), Poco::Message::PRIO_INFORMATION);
+ auto channel = (std::getenv("LOOL_LOGCOLOR")
+ ? static_cast<Poco::Channel*>(new Poco::ColorConsoleChannel())
+ : static_cast<Poco::Channel*>(new Poco::ConsoleChannel()));
+ auto& logger = Poco::Logger::create(SourceName, channel, Poco::Message::PRIO_INFORMATION);
// Configure the logger.
// TODO: This should come from a file.
More information about the Libreoffice-commits
mailing list