Move over to ABSL logging and flags.
Removes gperftools too since that wants gflags.
Here come the fireworks.
Change-Id: I79cb7bcf60f1047fbfa28bfffc21a0fd692e4b1c
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/y2022/localizer/localizer_replay.cc b/y2022/localizer/localizer_replay.cc
index a3baf3b..753d011 100644
--- a/y2022/localizer/localizer_replay.cc
+++ b/y2022/localizer/localizer_replay.cc
@@ -1,4 +1,4 @@
-#include "gflags/gflags.h"
+#include "absl/flags/flag.h"
#include "aos/configuration.h"
#include "aos/events/logging/log_reader.h"
@@ -12,11 +12,11 @@
#include "y2022/localizer/localizer.h"
#include "y2022/localizer/localizer_schema.h"
-DEFINE_string(config, "y2022/aos_config.json",
- "Name of the config file to replay using.");
-DEFINE_int32(team, 7971, "Team number to use for logfile replay.");
-DEFINE_string(output_folder, "/tmp/replayed",
- "Name of the folder to write replayed logs to.");
+ABSL_FLAG(std::string, config, "y2022/aos_config.json",
+ "Name of the config file to replay using.");
+ABSL_FLAG(int32_t, team, 7971, "Team number to use for logfile replay.");
+ABSL_FLAG(std::string, output_folder, "/tmp/replayed",
+ "Name of the folder to write replayed logs to.");
// TODO(james): Currently, this replay produces logfiles that can't be read due
// to time estimation issues. Pending the active refactorings of the
@@ -24,10 +24,10 @@
int main(int argc, char **argv) {
aos::InitGoogle(&argc, &argv);
- aos::network::OverrideTeamNumber(FLAGS_team);
+ aos::network::OverrideTeamNumber(absl::GetFlag(FLAGS_team));
const aos::FlatbufferDetachedBuffer<aos::Configuration> config =
- aos::configuration::ReadConfig(FLAGS_config);
+ aos::configuration::ReadConfig(absl::GetFlag(FLAGS_config));
// sort logfiles
const std::vector<aos::logger::LogFile> logfiles =
@@ -52,7 +52,7 @@
const std::vector<std::string> nodes_to_log = {"imu"};
std::vector<std::unique_ptr<aos::util::LoggerState>> loggers =
aos::util::MakeLoggersForNodes(reader.event_loop_factory(), nodes_to_log,
- FLAGS_output_folder);
+ absl::GetFlag(FLAGS_output_folder));
const aos::Node *node = nullptr;
if (aos::configuration::MultiNode(reader.configuration())) {