Skip to content

Commit

Permalink
fixes 114 sysdig-CLA-1.0-signed-off-by: Adam Baldwin baldwin@andyet.n…
Browse files Browse the repository at this point in the history
…et (#720)
  • Loading branch information
Adam Baldwin authored and luca3m committed Jan 18, 2017
1 parent 314b63a commit 8b2198f
Showing 1 changed file with 1 addition and 24 deletions.
25 changes: 1 addition & 24 deletions userspace/libsinsp/eventformatter.cpp
Expand Up @@ -31,7 +31,6 @@ extern sinsp_filter_check_list g_filterlist;
sinsp_evt_formatter::sinsp_evt_formatter(sinsp* inspector, const string& fmt)
{
m_inspector = inspector;
m_first = true;
set_format(fmt);
}

Expand Down Expand Up @@ -161,16 +160,6 @@ void sinsp_evt_formatter::set_format(const string& fmt)
bool sinsp_evt_formatter::on_capture_end(OUT string* res)
{
res->clear();
if(!m_first &&
(m_inspector->get_buffer_format() == sinsp_evt::PF_JSON
|| m_inspector->get_buffer_format() == sinsp_evt::PF_JSONEOLS
|| m_inspector->get_buffer_format() == sinsp_evt::PF_JSONHEX
|| m_inspector->get_buffer_format() == sinsp_evt::PF_JSONHEXASCII
|| m_inspector->get_buffer_format() == sinsp_evt::PF_JSONBASE64))
{
(*res) = ']';
}

return res->size() > 0;
}

Expand Down Expand Up @@ -256,19 +245,7 @@ bool sinsp_evt_formatter::tostring(sinsp_evt* evt, OUT string* res)
|| m_inspector->get_buffer_format() == sinsp_evt::PF_JSONHEXASCII
|| m_inspector->get_buffer_format() == sinsp_evt::PF_JSONBASE64)
{
if(m_first)
{
// Give it the opening stanza of a JSON array
(*res) = '[';
m_first = false;
}
else
{
// Otherwise say this is another object in an
// existing JSON array
(*res) = ",\n";
}

(*res) = "\n";
(*res) += m_writer.write( m_root );
(*res) = res->substr(0, res->size() - 1);
}
Expand Down

0 comments on commit 8b2198f

Please sign in to comment.