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/ping_lib.cc b/aos/events/ping_lib.cc
index f9958ff..e80fd75 100644
--- a/aos/events/ping_lib.cc
+++ b/aos/events/ping_lib.cc
@@ -12,14 +12,16 @@
 
 namespace chrono = std::chrono;
 
-Ping::Ping(EventLoop *event_loop)
+Ping::Ping(EventLoop *event_loop, std::string_view channel_name)
     : event_loop_(event_loop),
-      sender_(event_loop_->MakeSender<examples::Ping>("/test")) {
+      sender_(event_loop_->MakeSender<examples::Ping>(channel_name)) {
   timer_handle_ = event_loop_->AddTimer([this]() { SendPing(); });
   timer_handle_->set_name("ping");
 
-  event_loop_->MakeWatcher(
-      "/test", [this](const examples::Pong &pong) { HandlePong(pong); });
+  if (event_loop_->HasChannel<examples::Pong>(channel_name)) {
+    event_loop_->MakeWatcher(
+        channel_name, [this](const examples::Pong &pong) { HandlePong(pong); });
+  }
 
   event_loop_->OnRun([this]() {
     timer_handle_->Setup(event_loop_->monotonic_now(),