Allow renaming logged channels for replay

If we change an application to use a new channel for an existing
message, we need a way to support replaying old logs through it.
RenameLoggedChannel() provides an API to map the original channel to
the new one, updating the logged configuration as needed.

Since global maps for the new channel need not follow the same patterns
as the old one, any relevant maps must be specified by the user.

Change-Id: I68e9d2fe16bceaa60972a3f762f955e583c80255
Signed-off-by: Sanjay Narayanan <sanjay.narayanan@bluerivertech.com>
diff --git a/aos/events/logging/logger_test.cc b/aos/events/logging/logger_test.cc
index fcbd77b..7214a36 100644
--- a/aos/events/logging/logger_test.cc
+++ b/aos/events/logging/logger_test.cc
@@ -96,9 +96,6 @@
   // passing in a separate config.
   LogReader reader(logfile, &config_.message());
 
-  // Confirm that we can remap logged channels to point to new buses.
-  reader.RemapLoggedChannel<aos::examples::Ping>("/test", "/original");
-
   // This sends out the fetched messages and advances time to the start of the
   // log file.
   reader.Register();
@@ -111,8 +108,8 @@
   int ping_count = 10;
   int pong_count = 10;
 
-  // Confirm that the ping value matches in the remapped channel location.
-  test_event_loop->MakeWatcher("/original/test",
+  // Confirm that the ping value matches.
+  test_event_loop->MakeWatcher("/test",
                                [&ping_count](const examples::Ping &ping) {
                                  EXPECT_EQ(ping.value(), ping_count + 1);
                                  ++ping_count;
@@ -128,6 +125,7 @@
 
   reader.event_loop_factory()->RunFor(std::chrono::seconds(100));
   EXPECT_EQ(ping_count, 2010);
+  EXPECT_EQ(pong_count, ping_count);
 }
 
 // Tests calling StartLogging twice.