0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-10-03 06:08:52 +02:00

modules/console: Add ref list; improve output of event info cmd.

This commit is contained in:
Jason Volk 2019-02-06 16:50:19 -08:00
parent 4fa07b58a7
commit 2b3aec68ee

View file

@ -5489,7 +5489,11 @@ console_cmd__event(opt &out, const string_view &line)
}
}
out << pretty(event) << std::endl;
out << pretty(event)
<< std::endl;
out << event_idx
<< std::endl;
const m::event::conforms conforms
{
@ -5516,7 +5520,8 @@ console_cmd__event(opt &out, const string_view &line)
out << "- JSON NOT FOUND" << std::endl;
if(event.source)
out << "+ JSON SOURCE" << std::endl;
out << "+ JSON SOURCE " << size(string_view{event.source}) << " bytes."
<< std::endl;
if(event.source && !json::valid(event.source, std::nothrow))
out << "- JSON SOURCE INVALID" << std::endl;
@ -5524,7 +5529,20 @@ console_cmd__event(opt &out, const string_view &line)
if(cached)
out << "+ CACHED" << std::endl;
out << event_idx << std::endl;
const m::event::refs &refs{event_idx};
const auto refcnt(refs.count());
if(refcnt)
{
out << "+ REFERENCES " << refs.count() << std::endl;
refs.for_each([&out](const m::event::idx &idx)
{
out << "> " << idx << " " << m::event_id(idx)
<< std::endl;
return true;
});
}
return true;
}