Add explode on combined timestamp flag
It is useful to not fall back to combined timestamp channels in the
logging infrastructure. Add a flag so we can test it out.
Change-Id: Ifa50ec0cf1802904634b5a89d8324ec7c8bdab44
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/aos/network/timestamp_channel.cc b/aos/network/timestamp_channel.cc
index ab61051..fdaa031 100644
--- a/aos/network/timestamp_channel.cc
+++ b/aos/network/timestamp_channel.cc
@@ -2,6 +2,10 @@
#include "absl/strings/str_cat.h"
+DEFINE_bool(combined_timestamp_channel_fallback, true,
+ "If true, fall back to using the combined timestamp channel if the "
+ "single timestamp channel doesn't exist for a timestamp.");
+
namespace aos {
namespace message_bridge {
@@ -12,7 +16,8 @@
std::string ChannelTimestampFinder::SplitChannelName(
const Channel *channel, const Connection *connection) {
- return SplitChannelName(channel->name()->string_view(), channel->type()->str(), connection);
+ return SplitChannelName(channel->name()->string_view(),
+ channel->type()->str(), connection);
}
std::string ChannelTimestampFinder::SplitChannelName(
@@ -47,6 +52,15 @@
return split_timestamp_channel;
}
+ if (!FLAGS_combined_timestamp_channel_fallback) {
+ LOG(FATAL) << "Failed to find new timestamp channel {\"name\": \""
+ << split_timestamp_channel_name << "\", \"type\": \""
+ << RemoteMessage::GetFullyQualifiedName() << "\"} for "
+ << configuration::CleanedChannelToString(channel)
+ << " connection " << aos::FlatbufferToJson(connection)
+ << " and --nocombined_timestamp_channel_fallback is set";
+ }
+
const std::string shared_timestamp_channel_name =
CombinedChannelName(connection->name()->string_view());
const Channel *shared_timestamp_channel = configuration::GetChannel(