Add Logger::StartLoggingOnRun shortcut
Single node logger is on the way out, just use the multi-node one all
the time. Add a shortcut for that.
Change-Id: I8e9be85079641d620a41cddb62952cd1cd5252e6
diff --git a/aos/events/logging/log_writer.h b/aos/events/logging/log_writer.h
index 8e8e3ef..c546286 100644
--- a/aos/events/logging/log_writer.h
+++ b/aos/events/logging/log_writer.h
@@ -149,6 +149,15 @@
});
}
+ // Shortcut to call StartLogging with a MultiNodeLogNamer when event
+ // processing starts.
+ void StartLoggingOnRun(std::string base_name) {
+ event_loop_->OnRun([this, base_name]() {
+ StartLogging(std::make_unique<MultiNodeLogNamer>(
+ base_name, event_loop_->configuration(), event_loop_->node()));
+ });
+ }
+
private:
// Structure to track both a fetcher, and if the data fetched has been
// written. We may want to delay writing data to disk so that we don't let