]> git-server-git.apps.pok.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@inktank.com>
Mon, 14 Oct 2013 23:02:30 +0000 (16:02 -0700)
This applies to json-pretty and xml-pretty modes.

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

index 4ef833a45f80776ed352aba4a24ee8c66192d641..80b5ed0261d56344c247fd85b4037950e32483b9 100644 (file)
@@ -91,6 +91,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("");
 }
@@ -290,6 +292,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("");
 }