Factor out JsonOptions into a struct

Change-Id: I2441069e86ea2eb95d8e1952be7c2a7a43036c74
diff --git a/aos/events/logging/log_cat.cc b/aos/events/logging/log_cat.cc
index a1696eb..d3095cb 100644
--- a/aos/events/logging/log_cat.cc
+++ b/aos/events/logging/log_cat.cc
@@ -45,7 +45,7 @@
               << aos::FlatbufferToJson(
                      channel->schema(),
                      static_cast<const uint8_t *>(context.data),
-                     FLAGS_max_vector_size)
+                     {false, static_cast<size_t>(FLAGS_max_vector_size)})
               << std::endl;
   } else {
     std::cout << node_name << context.realtime_event_time << " ("
@@ -55,7 +55,7 @@
               << aos::FlatbufferToJson(
                      channel->schema(),
                      static_cast<const uint8_t *>(context.data),
-                     FLAGS_max_vector_size)
+                     {false, static_cast<size_t>(FLAGS_max_vector_size)})
               << std::endl;
   }
 }
@@ -93,16 +93,20 @@
 
       if (FLAGS_format_raw && message.value().message().data() != nullptr) {
         std::cout << aos::configuration::StrippedChannelToString(channel) << " "
-                  << aos::FlatbufferToJson(message.value(), false, 4) << ": "
+                  << aos::FlatbufferToJson(
+                         message.value(),
+                         {.multi_line = false, .max_vector_size = 4})
+                  << ": "
                   << aos::FlatbufferToJson(
                          channel->schema(),
                          message.value().message().data()->data(),
-                         FLAGS_max_vector_size)
+                         {false, static_cast<size_t>(FLAGS_max_vector_size)})
                   << std::endl;
       } else {
         std::cout << aos::configuration::StrippedChannelToString(channel) << " "
-                  << aos::FlatbufferToJson(message.value(), false,
-                                           FLAGS_max_vector_size)
+                  << aos::FlatbufferToJson(
+                         message.value(),
+                         {false, static_cast<size_t>(FLAGS_max_vector_size)})
                   << std::endl;
       }
     }
diff --git a/aos/events/logging/log_edit.cc b/aos/events/logging/log_edit.cc
index ff263f8..0dca904 100644
--- a/aos/events/logging/log_edit.cc
+++ b/aos/events/logging/log_edit.cc
@@ -18,8 +18,7 @@
     "If provided, this is the path to the JSON with the log file header.");
 
 int main(int argc, char **argv) {
-  gflags::SetUsageMessage(
-      R"(This tool lets us manipulate log files.)");
+  gflags::SetUsageMessage(R"(This tool lets us manipulate log files.)");
   aos::InitGoogle(&argc, &argv);
 
   if (!FLAGS_header.empty()) {
@@ -53,7 +52,8 @@
     } else {
       aos::logger::MessageReader reader(FLAGS_logfile);
       aos::util::WriteStringToFileOrDie(
-          FLAGS_header, aos::FlatbufferToJson(reader.log_file_header(), true));
+          FLAGS_header, aos::FlatbufferToJson(reader.log_file_header(),
+                                              {.multi_line = true}));
     }
   }