Add a pretty print flag for aos_dump and log_cat
Change-Id: If4f99fc17a63f155bcaa85b7efcbe08858eac04d
diff --git a/aos/aos_dump.cc b/aos/aos_dump.cc
index 62fb5cb..ac82b95 100644
--- a/aos/aos_dump.cc
+++ b/aos/aos_dump.cc
@@ -12,6 +12,8 @@
"If positive, vectors longer than this will not be printed");
DEFINE_bool(fetch, false,
"If true, fetch the current message on the channel first");
+DEFINE_bool(pretty, false,
+ "If true, pretty print the messages on multiple lines");
namespace {
@@ -23,9 +25,9 @@
// information on stderr.
builder->Reset();
- aos::FlatbufferToJson(builder, channel->schema(),
- static_cast<const uint8_t *>(context.data),
- {false, static_cast<size_t>(FLAGS_max_vector_size)});
+ aos::FlatbufferToJson(
+ builder, channel->schema(), static_cast<const uint8_t *>(context.data),
+ {FLAGS_pretty, static_cast<size_t>(FLAGS_max_vector_size)});
if (context.monotonic_remote_time != context.monotonic_event_time) {
std::cout << context.realtime_remote_time << " ("