Improve log_cats raw and fetching capabilities
Make --raw be able to print parsed messages. Much more useful than just
the headers.
Also, let --fetch control if we print out messages from before the start
of the log file.
Change-Id: I150bad1d5ac5b3caa7f5cab6ff6fe5cb7b4a7f67
diff --git a/aos/configuration.cc b/aos/configuration.cc
index cef3876..43e44f2 100644
--- a/aos/configuration.cc
+++ b/aos/configuration.cc
@@ -12,6 +12,7 @@
#include <string_view>
#include "absl/container/btree_set.h"
+#include "absl/strings/str_cat.h"
#include "aos/configuration_generated.h"
#include "aos/flatbuffer_merge.h"
#include "aos/json_to_flatbuffer.h"
@@ -539,6 +540,12 @@
return FlatbufferToJson(cleaned_channel);
}
+std::string StrippedChannelToString(const Channel *channel) {
+ return absl::StrCat("{ \"name\": \"", channel->name()->string_view(),
+ "\", \"type\": \"", channel->type()->string_view(),
+ "\" }");
+}
+
FlatbufferDetachedBuffer<Configuration> MergeConfiguration(
const Flatbuffer<Configuration> &config,
const std::vector<aos::FlatbufferString<reflection::Schema>> &schemas) {