From d4ab78a309f2932a87af7cd6854a0665f051077c Mon Sep 17 00:00:00 2001 From: Anthony Barbier Date: Wed, 9 Aug 2017 14:27:09 +0100 Subject: COMPMID-415 Fixed JSON printer to output errors as an array of single lines instead of a multi-line string Change-Id: I02a14fac2dbf31beb9c6e8a7744c47ccab207996 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/83374 Tested-by: Kaizen Reviewed-by: Moritz Pflanzer --- framework/printers/JSONPrinter.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'framework/printers') diff --git a/framework/printers/JSONPrinter.cpp b/framework/printers/JSONPrinter.cpp index 3408174b48..10cc911eba 100644 --- a/framework/printers/JSONPrinter.cpp +++ b/framework/printers/JSONPrinter.cpp @@ -102,9 +102,15 @@ void JSONPrinter::print_errors_footer() void JSONPrinter::print_error(const std::exception &error) { - print_separator(_first_error); + std::stringstream error_log; + error_log.str(error.what()); - *_stream << R"(")" << error.what() << R"(")"; + for(std::string line; !std::getline(error_log, line).eof();) + { + print_separator(_first_error); + + *_stream << R"(")" << line << R"(")"; + } } void JSONPrinter::print_measurements(const Profiler::MeasurementsMap &measurements) -- cgit v1.2.1