Fix AOS logging when using non-EventLoop configuration

Fixed crash in aos::Logger when reading back a log that was made
by providing a different configuration to the Logger than was
used by the event loop.

Change event_loop_to_logged_channel_index_ to use
`std::optional<uint32_t>` instead of `int`. Channel indices
should be uint32_t. Changed to optional because the channel can
be missing from the configuration specified in the logger
Constructor.

Change-Id: I5203b390689cab27cd79ee35b029cfdd0f98dfd8
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/aos/configuration.h b/aos/configuration.h
index 01b9e7c..7ef2e6e 100644
--- a/aos/configuration.h
+++ b/aos/configuration.h
@@ -248,6 +248,12 @@
     aos::FlatbufferVector<reflection::Schema> schema,
     const aos::Node *source_node = nullptr, ChannelT overrides = {});
 
+// Build a new configuration that only contains the channels we want to
+// include. This is useful for excluding obsolete or deprecated channels, so
+// they don't appear in the configuration when reading the log.
+FlatbufferDetachedBuffer<Configuration> GetPartialConfiguration(
+    const Configuration &configuration,
+    std::function<bool(const Channel &)> should_include_channel);
 }  // namespace configuration
 
 // Compare and equality operators for Channel.  Note: these only check the name