common/Formatter: add newline to flushed output if m_pretty

This applies to json-pretty and xml-pretty modes.

Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
Sage Weil 2013-10-14 16:02:30 -07:00 committed by Sage Weil
parent fc7fa3087d
commit 83c3b1305e

View 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("");
}