Merge "Ignore log files with corrupted headers too"
diff --git a/aos/events/logging/log_cat.cc b/aos/events/logging/log_cat.cc
index 7dabc18..6dd8369 100644
--- a/aos/events/logging/log_cat.cc
+++ b/aos/events/logging/log_cat.cc
@@ -32,6 +32,9 @@
              "If positive, vectors longer than this will not be printed");
 DEFINE_bool(pretty, false,
             "If true, pretty print the messages on multiple lines");
+DEFINE_bool(print, true,
+            "If true, actually print the messages.  If false, discard them, "
+            "confirming they can be parsed.");
 
 bool EndsWith(std::string_view str, std::string_view ending) {
   return str.size() >= ending.size() &&
@@ -238,7 +241,9 @@
         printer_event_loop->MakeRawWatcher(
             channel, [channel, node_name, &builder](const aos::Context &context,
                                                     const void * /*message*/) {
-              PrintMessage(node_name, channel, context, &builder);
+              if (FLAGS_print) {
+                PrintMessage(node_name, channel, context, &builder);
+              }
             });
         found_channel = true;
       }
@@ -247,8 +252,10 @@
     // Print the messages from before the log start time.
     // TODO(austin): Sort between nodes too when it becomes annoying enough.
     for (const MessageInfo &message : messages_before_start) {
-      PrintMessage(message.node_name, message.fetcher->channel(),
-                   message.fetcher->context(), &builder);
+      if (FLAGS_print) {
+        PrintMessage(message.node_name, message.fetcher->channel(),
+                     message.fetcher->context(), &builder);
+      }
     }
     printer_event_loops.emplace_back(std::move(printer_event_loop));
 
diff --git a/aos/events/simulated_event_loop.cc b/aos/events/simulated_event_loop.cc
index 4c28039..9c8bb09 100644
--- a/aos/events/simulated_event_loop.cc
+++ b/aos/events/simulated_event_loop.cc
@@ -856,7 +856,9 @@
     aos::monotonic_clock::time_point monotonic_remote_time,
     aos::realtime_clock::time_point realtime_remote_time,
     uint32_t remote_queue_index) {
-  CHECK_LE(size, this->size()) << ": Attempting to send too big a message.";
+  CHECK_LE(size, this->size())
+      << ": Attempting to send too big a message on "
+      << configuration::CleanedChannelToString(simulated_channel_->channel());
 
   // This is wasteful, but since flatbuffers fill from the back end of the
   // queue, we need it to be full sized.