From 83c3b1305e592637ac3c511984fb572d6502d0be Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 14 Oct 2013 16:02:30 -0700 Subject: [PATCH] common/Formatter: add newline to flushed output if m_pretty This applies to json-pretty and xml-pretty modes. Signed-off-by: Sage Weil --- src/common/Formatter.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/common/Formatter.cc b/src/common/Formatter.cc index 93714c51630dd..f24a25d36ecd0 100644 --- a/src/common/Formatter.cc +++ b/src/common/Formatter.cc @@ -123,6 +123,8 @@ void JSONFormatter::flush(std::ostream& os) { finish_pending_string(); os << m_ss.str(); + if (m_pretty) + os << "\n"; m_ss.clear(); m_ss.str(""); } @@ -312,6 +314,8 @@ void XMLFormatter::flush(std::ostream& os) { finish_pending_string(); os << m_ss.str(); + if (m_pretty) + os << "\n"; m_ss.clear(); m_ss.str(""); } -- 2.39.5