Print logger_.*_start_time in log_cat
These fields are helpful for telling what is being logged when.
Change-Id: I7e62eb239acedb5dc984718c666baedf85972331
Signed-off-by: Austin Schuh <austin.schuh@bluerivertech.com>
diff --git a/aos/events/logging/log_cat.cc b/aos/events/logging/log_cat.cc
index 3469674..c040f22 100644
--- a/aos/events/logging/log_cat.cc
+++ b/aos/events/logging/log_cat.cc
@@ -95,6 +95,12 @@
const aos::logger::LogFileHeader *full_header = reader.log_file_header();
if (!FLAGS_raw_header.empty()) {
raw_header_reader.emplace(FLAGS_raw_header);
+ std::cout << aos::FlatbufferToJson(
+ reader.log_file_header(),
+ {.multi_line = FLAGS_pretty,
+ .max_vector_size =
+ static_cast<size_t>(FLAGS_max_vector_size)})
+ << std::endl;
CHECK_EQ(
reader.log_file_header()->configuration_sha256()->string_view(),
aos::logger::Sha256(raw_header_reader->raw_log_file_header().span()));
diff --git a/aos/events/logging/logfile_sorting.cc b/aos/events/logging/logfile_sorting.cc
index 80d909b..bdb7dd5 100644
--- a/aos/events/logging/logfile_sorting.cc
+++ b/aos/events/logging/logfile_sorting.cc
@@ -615,6 +615,14 @@
if (!parts.config_sha256.empty()) {
stream << ",\n \"config_sha256\": \"" << parts.config_sha256 << "\"";
}
+ if (parts.logger_monotonic_start_time != aos::monotonic_clock::min_time) {
+ stream << ",\n \"logger_monotonic_start_time\": \""
+ << parts.logger_monotonic_start_time << "\"";
+ }
+ if (parts.logger_realtime_start_time != aos::realtime_clock::min_time) {
+ stream << ",\n \"logger_realtime_start_time\": \""
+ << parts.logger_realtime_start_time << "\"";
+ }
stream << ",\n \"monotonic_start_time\": " << parts.monotonic_start_time
<< ",\n \"realtime_start_time\": " << parts.realtime_start_time
<< ",\n \"parts\": [";