loolwsd/Util.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
New commits: commit 18a224b4135457ca59cb17c962ccb9c8c8e7c510 Author: Ashod Nakashian <ashod.nakash...@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 <ashnak...@gmail.com> Tested-by: Ashod Nakashian <ashnak...@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. _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits