Clang-format logger
Change-Id: I8d1c06e076f6e4f6d4321861b93de1fa66c13be9
diff --git a/aos/events/logging/eigen_mpq.h b/aos/events/logging/eigen_mpq.h
index 1463648..370d77e 100644
--- a/aos/events/logging/eigen_mpq.h
+++ b/aos/events/logging/eigen_mpq.h
@@ -8,8 +8,7 @@
// TypeTraits for mpq_class. This is only really enough to use inverse().
template <>
-struct NumTraits<mpq_class>
- : GenericNumTraits<mpq_class> {
+struct NumTraits<mpq_class> : GenericNumTraits<mpq_class> {
typedef mpq_class Real;
typedef mpq_class Literal;
typedef mpq_class NonInteger;
diff --git a/aos/events/logging/log_namer.h b/aos/events/logging/log_namer.h
index cec7ad8..7611cb8 100644
--- a/aos/events/logging/log_namer.h
+++ b/aos/events/logging/log_namer.h
@@ -133,8 +133,8 @@
DetachedBufferWriter *MakeWriter(const Channel *channel) override;
- DetachedBufferWriter *MakeForwardedTimestampWriter(
- const Channel *channel, const Node *node) override;
+ DetachedBufferWriter *MakeForwardedTimestampWriter(const Channel *channel,
+ const Node *node) override;
DetachedBufferWriter *MakeTimestampWriter(const Channel *channel) override;
diff --git a/aos/events/logging/logfile_utils.cc b/aos/events/logging/logfile_utils.cc
index 4725801..26c3825 100644
--- a/aos/events/logging/logfile_utils.cc
+++ b/aos/events/logging/logfile_utils.cc
@@ -40,8 +40,7 @@
VLOG(1) << "Closed " << filename_;
}
-DetachedBufferWriter::DetachedBufferWriter(
- DetachedBufferWriter &&other) {
+DetachedBufferWriter::DetachedBufferWriter(DetachedBufferWriter &&other) {
*this = std::move(other);
}
@@ -566,8 +565,8 @@
chrono::nanoseconds(header.monotonic_sent_time()));
if (VLOG_IS_ON(2)) {
- LOG(INFO) << MaybeNodeName(target_node_) << "Queued " << this
- << " " << filename() << " ttq: " << time_to_queue_ << " now "
+ LOG(INFO) << MaybeNodeName(target_node_) << "Queued " << this << " "
+ << filename() << " ttq: " << time_to_queue_ << " now "
<< newest_timestamp() << " start time "
<< monotonic_start_time() << " " << FlatbufferToJson(&header);
} else if (VLOG_IS_ON(1)) {
@@ -1230,9 +1229,8 @@
(reader->node() != nullptr) && (target_node != nullptr) &&
(reader->node()->has_name() && target_node->has_name());
const bool node_names_identical =
- both_have_name &&
- (reader->node()->name()->string_view() ==
- target_node->name()->string_view());
+ both_have_name && (reader->node()->name()->string_view() ==
+ target_node->name()->string_view());
if (both_null || node_names_identical) {
if (!found_node) {
found_node = true;
diff --git a/aos/events/logging/logger.cc b/aos/events/logging/logger.cc
index aee3f8b..3032a6f 100644
--- a/aos/events/logging/logger.cc
+++ b/aos/events/logging/logger.cc
@@ -35,7 +35,6 @@
namespace logger {
namespace chrono = std::chrono;
-
Logger::Logger(std::string_view base_name, EventLoop *event_loop,
std::chrono::milliseconds polling_period)
: Logger(base_name, event_loop, event_loop->configuration(),
@@ -107,8 +106,8 @@
timestamp_logger_channels.insert(std::make_pair(channel, node));
}
- const size_t our_node_index = configuration::GetNodeIndex(
- configuration_, event_loop_->node());
+ const size_t our_node_index =
+ configuration::GetNodeIndex(configuration_, event_loop_->node());
for (const Channel *config_channel : *configuration_->channels()) {
// The MakeRawFetcher method needs a channel which is in the event loop
@@ -179,8 +178,7 @@
: 1u);
for (const Node *node : log_namer_->nodes()) {
- const int node_index =
- configuration::GetNodeIndex(configuration_, node);
+ const int node_index = configuration::GetNodeIndex(configuration_, node);
node_state_[node_index].log_file_header = MakeHeader(node);
}
@@ -238,8 +236,7 @@
last_synchronized_time_ = monotonic_start_time;
for (const Node *node : log_namer_->nodes()) {
- const int node_index =
- configuration::GetNodeIndex(configuration_, node);
+ const int node_index = configuration::GetNodeIndex(configuration_, node);
MaybeUpdateTimestamp(node, node_index, monotonic_start_time,
realtime_start_time);
log_namer_->WriteHeader(&node_state_[node_index].log_file_header, node);
@@ -258,8 +255,7 @@
}
for (const Node *node : log_namer_->nodes()) {
- const int node_index =
- configuration::GetNodeIndex(configuration_, node);
+ const int node_index = configuration::GetNodeIndex(configuration_, node);
if (MaybeUpdateTimestamp(
node, node_index,
server_statistics_fetcher_.context().monotonic_event_time,
@@ -413,8 +409,7 @@
void Logger::Rotate() {
for (const Node *node : log_namer_->nodes()) {
- const int node_index =
- configuration::GetNodeIndex(configuration_, node);
+ const int node_index = configuration::GetNodeIndex(configuration_, node);
log_namer_->Rotate(node, &node_state_[node_index].log_file_header);
}
}
@@ -573,7 +568,8 @@
// Tuple of time for the data and filename needed for sorting after
// extracting.
- std::vector<std::pair<monotonic_clock::time_point, std::string>> unsorted_parts;
+ std::vector<std::pair<monotonic_clock::time_point, std::string>>
+ unsorted_parts;
};
// A list of all the old parts which we don't know how to sort using uuids.
@@ -636,9 +632,9 @@
auto log_it = parts_list.find(logger_uuid);
if (log_it == parts_list.end()) {
log_it = parts_list
- .insert(std::make_pair(
- logger_uuid, std::map<std::string, UnsortedLogParts>()))
- .first;
+ .insert(std::make_pair(
+ logger_uuid, std::map<std::string, UnsortedLogParts>()))
+ .first;
}
auto it = log_it->second.find(parts_uuid);
@@ -694,7 +690,8 @@
// Now, sort them and produce the final vector form.
std::vector<LogFile> result;
result.reserve(parts_list.size());
- for (std::pair<const std::string, std::map<std::string, UnsortedLogParts>> &logs : parts_list) {
+ for (std::pair<const std::string, std::map<std::string, UnsortedLogParts>>
+ &logs : parts_list) {
LogFile new_file;
new_file.logger_uuid = logs.first;
for (std::pair<const std::string, UnsortedLogParts> &parts : logs.second) {
@@ -893,8 +890,7 @@
event_loop_factory_ = event_loop_factory;
remapped_configuration_ = event_loop_factory_->configuration();
- for (const Node *node :
- configuration::GetNodes(configuration())) {
+ for (const Node *node : configuration::GetNodes(configuration())) {
const size_t node_index =
configuration::GetNodeIndex(configuration(), node);
states_[node_index] =
@@ -1242,7 +1238,6 @@
}
}
-
void LogReader::Register(EventLoop *event_loop) {
State *state =
states_[configuration::GetNodeIndex(configuration(), event_loop->node())]
@@ -1466,9 +1461,8 @@
});
for (size_t i = 0; i < states_.size(); ++i) {
- VLOG(1) << MaybeNodeName(
- states_[i]->event_loop()->node())
- << "before " << states_[i]->monotonic_now();
+ VLOG(1) << MaybeNodeName(states_[i]->event_loop()->node()) << "before "
+ << states_[i]->monotonic_now();
}
UpdateOffsets();
@@ -1476,9 +1470,8 @@
<< state->monotonic_now();
for (size_t i = 0; i < states_.size(); ++i) {
- VLOG(1) << MaybeNodeName(
- states_[i]->event_loop()->node())
- << "after " << states_[i]->monotonic_now();
+ VLOG(1) << MaybeNodeName(states_[i]->event_loop()->node()) << "after "
+ << states_[i]->monotonic_now();
}
// TODO(austin): We should be perfect.
diff --git a/aos/events/logging/logger_main.cc b/aos/events/logging/logger_main.cc
index f95fa17..d77d72b 100644
--- a/aos/events/logging/logger_main.cc
+++ b/aos/events/logging/logger_main.cc
@@ -1,8 +1,8 @@
#include "aos/configuration.h"
#include "aos/events/logging/logger.h"
#include "aos/events/shm_event_loop.h"
-#include "aos/logging/log_namer.h"
#include "aos/init.h"
+#include "aos/logging/log_namer.h"
#include "gflags/gflags.h"
#include "glog/logging.h"
diff --git a/aos/events/logging/logger_test.cc b/aos/events/logging/logger_test.cc
index d4b6424..707a232 100644
--- a/aos/events/logging/logger_test.cc
+++ b/aos/events/logging/logger_test.cc
@@ -995,7 +995,8 @@
for (const LogParts &part : log_file.parts) {
EXPECT_NE(part.monotonic_start_time, aos::monotonic_clock::min_time)
<< ": " << part;
- missing_rt_count += part.realtime_start_time == aos::realtime_clock::min_time;
+ missing_rt_count +=
+ part.realtime_start_time == aos::realtime_clock::min_time;
EXPECT_TRUE(logger_uuids.find(part.logger_uuid) != logger_uuids.end());
EXPECT_NE(part.node, "");