]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/Formatter: add newline to flushed output if m_pretty
authorSage Weil <sage@inktank.com>
Mon, 14 Oct 2013 23:02:30 +0000 (16:02 -0700)
committerSage Weil <sage@redhat.com>
Tue, 13 Jan 2015 16:06:17 +0000 (08:06 -0800)
This applies to json-pretty and xml-pretty modes.

Signed-off-by: Sage Weil <sage@inktank.com>
src/common/Formatter.cc

index 93714c51630ddd5b44d08bfb30374b63bbbc8761..f24a25d36ecd0f5203bac4fcb3ce533f5130f348 100644 (file)
@@ -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("");
 }