From 252fcab570d20a4a27860cbc73fdf0af19ca2d2c Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Thu, 17 Mar 2016 17:05:50 -0400 Subject: [PATCH] Log: Added support for multi-line log entries, which are split --- src/Log.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Log.cpp b/src/Log.cpp index 4ebfda24..93591e90 100644 --- a/src/Log.cpp +++ b/src/Log.cpp @@ -26,6 +26,7 @@ #include #include +#include #include //////////////////////////////////////////////////////////////////////////////// @@ -50,6 +51,16 @@ void Log::write (const std::string& category, const std::string& line) if (line != "") { + // If line contains newlines, split it into separate lines and log each one. + if (line.find ("\n") != std::string::npos) + { + for (const auto& single : split (line, '\n')) + write (category, single); + + return; + } + + // Single line. if (line == _prior) { ++_repetition;