Create AOS MCAP logger for testing Foxglove

Doesn't add indexing yet, so still limited in size.

https://github.com/foxglove/studio/issues/2909 tracks support for
flatbuffers in foxglove studio

References: PRO-13587
Change-Id: I7c8c15c765395ade979eb8a011cfdae65451b526
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/aos/util/BUILD b/aos/util/BUILD
index 8df16e2..3b96cfd 100644
--- a/aos/util/BUILD
+++ b/aos/util/BUILD
@@ -34,6 +34,42 @@
     ],
 )
 
+cc_binary(
+    name = "log_to_mcap",
+    srcs = ["log_to_mcap.cc"],
+    deps = [
+        ":mcap_logger",
+        "//aos:init",
+        "//aos/events/logging:log_reader",
+        "//frc971/control_loops:control_loops_fbs",
+    ],
+)
+
+cc_library(
+    name = "mcap_logger",
+    srcs = ["mcap_logger.cc"],
+    hdrs = ["mcap_logger.h"],
+    target_compatible_with = ["@platforms//os:linux"],
+    deps = [
+        "//aos:configuration_fbs",
+        "//aos:fast_string_builder",
+        "//aos:flatbuffer_utils",
+        "//aos/events:event_loop",
+        "@com_github_nlohmann_json//:json",
+    ],
+)
+
+cc_test(
+    name = "mcap_logger_test",
+    srcs = ["mcap_logger_test.cc"],
+    target_compatible_with = ["@platforms//os:linux"],
+    deps = [
+        ":mcap_logger",
+        "//aos/testing:googletest",
+        "@com_github_nlohmann_json//:json",
+    ],
+)
+
 cc_library(
     name = "math",
     hdrs = ["math.h"],