summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-10-14 16:02:30 -0700
committerSage Weil <sage@inktank.com>2013-10-14 16:02:30 -0700
commitd6146b0d915f1420b5e76f7037f656460c314461 (patch)
tree2a4b4b89cbe887395ef4626bfb6b7d02cec8fe6d
parent7f0d644cb47394c7e2ff625ebfbef81a88af1e3b (diff)
downloadceph-d6146b0d915f1420b5e76f7037f656460c314461.tar.gz
common/Formatter: add newline to flushed output if m_prettywip-formatter-newlines
This applies to json-pretty and xml-pretty modes. Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r--src/common/Formatter.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/common/Formatter.cc b/src/common/Formatter.cc
index 4ef833a45f8..80b5ed0261d 100644
--- a/src/common/Formatter.cc
+++ b/src/common/Formatter.cc
@@ -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("");
}