Make log_cat handle multinode channel filtering

PReviously, it LOG(FATAL)'d if the channel you were looking for wasn't
available on all of the ndoes.

Change-Id: I3298ad5463f820da8ea174ba5453d09336110712
diff --git a/aos/events/logging/log_cat.cc b/aos/events/logging/log_cat.cc
index 79ea1e3..e0da59e 100644
--- a/aos/events/logging/log_cat.cc
+++ b/aos/events/logging/log_cat.cc
@@ -165,6 +165,8 @@
 
   std::vector<std::unique_ptr<aos::EventLoop>> printer_event_loops;
 
+  bool found_channel = false;
+
   for (const aos::Node *node : reader.Nodes()) {
     std::unique_ptr<aos::EventLoop> printer_event_loop =
         event_loop_factory.MakeEventLoop("printer", node);
@@ -177,7 +179,6 @@
     };
     std::vector<MessageInfo> messages_before_start;
 
-    bool found_channel = false;
     const flatbuffers::Vector<flatbuffers::Offset<aos::Channel>> *channels =
         printer_event_loop->configuration()->channels();
 
@@ -235,10 +236,6 @@
       }
     }
 
-    if (!found_channel) {
-      LOG(FATAL) << "Could not find any channels";
-    }
-
     // 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) {
@@ -254,6 +251,10 @@
     std::cout << std::endl << std::endl;
   }
 
+  if (!found_channel) {
+    LOG(FATAL) << "Could not find any channels";
+  }
+
   if (FLAGS_fetch) {
     // New line to separate fetched messages from non-fetched messages.
     std::cout << std::endl;