Fix lint issues in logging/

Bug: None
Change-Id: I998b3da0294bbf71f852c5947577622619c832d8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361262
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42941}
diff --git a/logging/rtc_event_log/events/rtc_event_field_encoding.cc b/logging/rtc_event_log/events/rtc_event_field_encoding.cc
index 08f7e84..6294eee 100644
--- a/logging/rtc_event_log/events/rtc_event_field_encoding.cc
+++ b/logging/rtc_event_log/events/rtc_event_field_encoding.cc
@@ -185,7 +185,7 @@
     RTC_DCHECK_EQ(values.size(), batch_size_);
   }
 
-  if (values.size() == 0) {
+  if (values.empty()) {
     // If all values for a particular field is empty/nullopt,
     // then we completely skip the field even if the the batch is non-empty.
     return;
@@ -240,7 +240,7 @@
                                const std::vector<absl::string_view>& values) {
   RTC_DCHECK_EQ(values.size(), batch_size_);
 
-  if (values.size() == 0) {
+  if (values.empty()) {
     // If all values for a particular field is empty/nullopt,
     // then we completely skip the field even if the the batch is non-empty.
     return;
diff --git a/logging/rtc_event_log/events/rtc_event_field_encoding_unittest.cc b/logging/rtc_event_log/events/rtc_event_field_encoding_unittest.cc
index 5fd6928..ba2e769 100644
--- a/logging/rtc_event_log/events/rtc_event_field_encoding_unittest.cc
+++ b/logging/rtc_event_log/events/rtc_event_field_encoding_unittest.cc
@@ -6,6 +6,7 @@
  *  in the file PATENTS.  All contributing project authors may
  *  be found in the AUTHORS file in the root of the source tree.
  */
+
 #include "logging/rtc_event_log/events/rtc_event_field_encoding.h"
 
 #include <cstddef>
@@ -592,21 +593,21 @@
   ParseEventHeader(s);
   ParseAndVerifyTimestamps();
   ParseAndVerifyField(RtcTestEvent::bool_params, bool_values,
-                      /*delta bits*/ 1);
+                      /*expected_bits_per_delta=*/1);
   ParseAndVerifyField(RtcTestEvent::signed32_params, signed32_values,
-                      /*delta bits*/ 1);
+                      /*expected_bits_per_delta=*/1);
   ParseAndVerifyField(RtcTestEvent::unsigned32_params, unsigned32_values,
-                      /*delta bits*/ 1);
+                      /*expected_bits_per_delta=*/1);
   ParseAndVerifyField(RtcTestEvent::signed64_params, signed64_values,
-                      /*delta bits*/ 1);
+                      /*expected_bits_per_delta=*/1);
   ParseAndVerifyField(RtcTestEvent::unsigned64_params, unsigned64_values,
-                      /*delta bits*/ 1);
+                      /*expected_bits_per_delta=*/1);
   ParseAndVerifyOptionalField(RtcTestEvent::optional32_params,
-                              optional32_values, /*delta bits*/ 1);
+                              optional32_values, /*expected_bits_per_delta=*/1);
   ParseAndVerifyOptionalField(RtcTestEvent::optional64_params,
-                              optional64_values, /*delta bits*/ 1);
+                              optional64_values, /*expected_bits_per_delta=*/1);
   ParseAndVerifyField(RtcTestEvent::wrapping21_params, wrapping21_values,
-                      /*delta bits*/ 1);
+                      /*expected_bits_per_delta=*/1);
   ParseAndVerifyStringField(RtcTestEvent::string_params, string_values);
   EXPECT_EQ(parser_.RemainingBytes(), 0u);
 }
@@ -663,21 +664,21 @@
   ParseEventHeader(s);
   ParseAndVerifyTimestamps();
   ParseAndVerifyField(RtcTestEvent::bool_params, bool_values,
-                      /*delta bits*/ 1);
+                      /*expected_bits_per_delta=*/1);
   ParseAndVerifyField(RtcTestEvent::signed32_params, signed32_values,
-                      /*delta bits*/ 1);
+                      /*expected_bits_per_delta=*/1);
   ParseAndVerifyField(RtcTestEvent::unsigned32_params, unsigned32_values,
-                      /*delta bits*/ 1);
+                      /*expected_bits_per_delta=*/1);
   ParseAndVerifyField(RtcTestEvent::signed64_params, signed64_values,
-                      /*delta bits*/ 1);
+                      /*expected_bits_per_delta=*/1);
   ParseAndVerifyField(RtcTestEvent::unsigned64_params, unsigned64_values,
-                      /*delta bits*/ 1);
+                      /*expected_bits_per_delta=*/1);
   ParseAndVerifyOptionalField(RtcTestEvent::optional32_params,
-                              optional32_values, /*delta bits*/ 1);
+                              optional32_values, /*expected_bits_per_delta=*/1);
   ParseAndVerifyOptionalField(RtcTestEvent::optional64_params,
-                              optional64_values, /*delta bits*/ 1);
+                              optional64_values, /*expected_bits_per_delta=*/1);
   ParseAndVerifyField(RtcTestEvent::wrapping21_params, wrapping21_values,
-                      /*delta bits*/ 1);
+                      /*expected_bits_per_delta=*/1);
   ParseAndVerifyStringField(RtcTestEvent::string_params, string_values);
   EXPECT_EQ(parser_.RemainingBytes(), 0u);
 }
@@ -740,23 +741,23 @@
   ParseEventHeader(s);
   ParseAndVerifyTimestamps();
   ParseAndVerifyField(RtcTestEvent::bool_params, bool_values,
-                      /*delta_bits=*/1);
+                      /*expected_bits_per_delta=*/1);
   // Skips parsing the `signed32_values`. The following unsigned fields should
   // still be found.
   ParseAndVerifyField(RtcTestEvent::unsigned32_params, unsigned32_values,
-                      /*delta_bits=*/31,
+                      /*expected_bits_per_delta=*/31,
                       /*expected_skipped_bytes=*/signed32_encoding_size);
   // Skips parsing the `signed64_values`. The following unsigned fields should
   // still be found.
   ParseAndVerifyField(RtcTestEvent::unsigned64_params, unsigned64_values,
-                      /*delta_bits=*/63, signed64_encoding_size);
+                      /*expected_bits_per_delta=*/63, signed64_encoding_size);
   // Skips parsing the `optional32_values`. The following unsigned fields should
   // still be found.
-  ParseAndVerifyOptionalField(RtcTestEvent::optional64_params,
-                              optional64_values,
-                              /*delta_bits=*/63, optional32_encoding_size);
+  ParseAndVerifyOptionalField(
+      RtcTestEvent::optional64_params, optional64_values,
+      /*expected_bits_per_delta=*/63, optional32_encoding_size);
   ParseAndVerifyField(RtcTestEvent::wrapping21_params, wrapping21_values,
-                      /*delta_bits=*/20);
+                      /*expected_bits_per_delta=*/20);
   ParseAndVerifyStringField(RtcTestEvent::string_params, string_values);
   EXPECT_EQ(parser_.RemainingBytes(), 0u);
 }
@@ -806,16 +807,17 @@
   ParseAndVerifyTimestamps();
   ParseAndVerifyMissingField(RtcTestEvent::bool_params);
   ParseAndVerifyField(RtcTestEvent::signed32_params, signed32_values,
-                      /*delta_bits=*/31);
+                      /*expected_bits_per_delta=*/31);
   ParseAndVerifyMissingField(RtcTestEvent::unsigned32_params);
   ParseAndVerifyField(RtcTestEvent::signed64_params, signed64_values,
-                      /*delta_bits=*/63);
+                      /*expected_bits_per_delta=*/63);
   ParseAndVerifyMissingField(RtcTestEvent::unsigned64_params);
   ParseAndVerifyOptionalField(RtcTestEvent::optional32_params,
-                              optional32_values, /*delta_bits=*/31);
+                              optional32_values,
+                              /*expected_bits_per_delta=*/31);
   ParseAndVerifyMissingOptionalField(RtcTestEvent::optional64_params);
   ParseAndVerifyField(RtcTestEvent::wrapping21_params, wrapping21_values,
-                      /*delta_bits=*/20);
+                      /*expected_bits_per_delta=*/20);
   ParseAndVerifyStringField(RtcTestEvent::string_params, string_values);
   EXPECT_EQ(parser_.RemainingBytes(), 0u);
 }
@@ -851,11 +853,11 @@
   ParseEventHeader(s);
   ParseAndVerifyTimestamps();
   ParseAndVerifyOptionalField(RtcTestEvent::optional32_params,
-                              optional32_values, /*delta bits*/ 2);
+                              optional32_values, /*expected_bits_per_delta=*/2);
   ParseAndVerifyOptionalField(RtcTestEvent::optional64_params,
-                              optional64_values, /*delta bits*/ 1);
+                              optional64_values, /*expected_bits_per_delta=*/1);
   ParseAndVerifyField(RtcTestEvent::wrapping21_params, wrapping21_values,
-                      /*delta bits*/ 2);
+                      /*expected_bits_per_delta=*/2);
   EXPECT_EQ(parser_.RemainingBytes(), 0u);
 }
 
@@ -887,7 +889,7 @@
   ParseAndVerifyTimestamps();
   ParseAndVerifyMissingOptionalField(RtcTestEvent::optional32_params);
   ParseAndVerifyOptionalField(RtcTestEvent::optional64_params,
-                              optional64_values, /*delta_bits=*/1);
+                              optional64_values, /*expected_bits_per_delta=*/1);
   EXPECT_EQ(parser_.RemainingBytes(), 0u);
 }
 
diff --git a/logging/rtc_event_log/rtc_event_log_impl_unittest.cc b/logging/rtc_event_log/rtc_event_log_impl_unittest.cc
index 6ab2d2f..f2bde75 100644
--- a/logging/rtc_event_log/rtc_event_log_impl_unittest.cc
+++ b/logging/rtc_event_log/rtc_event_log_impl_unittest.cc
@@ -38,7 +38,6 @@
 using ::testing::Property;
 using ::testing::Ref;
 using ::testing::Return;
-using ::testing::StrEq;
 
 class MockEventEncoder : public RtcEventLogEncoder {
  public:
diff --git a/logging/rtc_event_log/rtc_event_log_parser.cc b/logging/rtc_event_log/rtc_event_log_parser.cc
index 7197c97..601a1ba 100644
--- a/logging/rtc_event_log/rtc_event_log_parser.cc
+++ b/logging/rtc_event_log/rtc_event_log_parser.cc
@@ -1783,8 +1783,7 @@
     case rtclog::Event::AUDIO_NETWORK_ADAPTATION_EVENT: {
       auto status_or_value = GetAudioNetworkAdaptation(event);
       RTC_RETURN_IF_ERROR(status_or_value.status());
-      LoggedAudioNetworkAdaptationEvent ana_event = status_or_value.value();
-      audio_network_adaptation_events_.push_back(ana_event);
+      audio_network_adaptation_events_.push_back(status_or_value.value());
       break;
     }
     case rtclog::Event::BWE_PROBE_CLUSTER_CREATED_EVENT: {
@@ -2393,10 +2392,11 @@
       int64_t unwrapped_seq_num =
           seq_num_unwrapper.Unwrap(logged.transport_seq_no);
       if (indices.find(unwrapped_seq_num) != indices.end()) {
-        auto prev = packets[indices[unwrapped_seq_num]];
+        Timestamp prev_log_packet_time =
+            packets[indices[unwrapped_seq_num]].log_packet_time;
         RTC_LOG(LS_WARNING)
             << "Repeated sent packet sequence number: " << unwrapped_seq_num
-            << " Packet time:" << prev.log_packet_time.seconds() << "s vs "
+            << " Packet time:" << prev_log_packet_time.seconds() << "s vs "
             << logged.log_packet_time.seconds()
             << "s at:" << rtp.log_time_ms() / 1000;
       }
@@ -2538,7 +2538,7 @@
   return log_events;
 }
 
-const std::vector<MatchedSendArrivalTimes> GetNetworkTrace(
+std::vector<MatchedSendArrivalTimes> GetNetworkTrace(
     const ParsedRtcEventLog& parsed_log) {
   std::vector<MatchedSendArrivalTimes> rtp_rtcp_matched;
   for (auto& packet :
diff --git a/logging/rtc_event_log/rtc_event_log_parser.h b/logging/rtc_event_log/rtc_event_log_parser.h
index f974f04..1dd65e7 100644
--- a/logging/rtc_event_log/rtc_event_log_parser.h
+++ b/logging/rtc_event_log/rtc_event_log_parser.h
@@ -390,7 +390,7 @@
   void Clear();
 
   // Reads an RtcEventLog file and returns success if parsing was successful.
-  ParseStatus ParseFile(absl::string_view file_name);
+  ParseStatus ParseFile(absl::string_view filename);
 
   // Reads an RtcEventLog from a string and returns success if successful.
   ParseStatus ParseString(absl::string_view s);
@@ -783,7 +783,7 @@
   ParseStatus StoreOutgoingRtcpPackets(
       const rtclog2::OutgoingRtcpPackets& proto);
   ParseStatus StoreOutgoingRtpPackets(const rtclog2::OutgoingRtpPackets& proto);
-  ParseStatus StoreParsedNewFormatEvent(const rtclog2::EventStream& event);
+  ParseStatus StoreParsedNewFormatEvent(const rtclog2::EventStream& stream);
   ParseStatus StoreRouteChangeEvent(const rtclog2::RouteChange& proto);
   ParseStatus StoreRemoteEstimateEvent(const rtclog2::RemoteEstimates& proto);
   ParseStatus StoreStartEvent(const rtclog2::BeginLogEvent& proto);
@@ -942,7 +942,8 @@
   int64_t arrival_time_ms;  // kNotReceived for lost packets.
   int64_t payload_size;
 };
-const std::vector<MatchedSendArrivalTimes> GetNetworkTrace(
+
+std::vector<MatchedSendArrivalTimes> GetNetworkTrace(
     const ParsedRtcEventLog& parsed_log);
 
 }  // namespace webrtc
diff --git a/logging/rtc_event_log/rtc_event_log_unittest.cc b/logging/rtc_event_log/rtc_event_log_unittest.cc
index df30e63..eafe857 100644
--- a/logging/rtc_event_log/rtc_event_log_unittest.cc
+++ b/logging/rtc_event_log/rtc_event_log_unittest.cc
@@ -158,10 +158,10 @@
     temp_filename_ = test::OutputPath() + test_name;
   }
 
-  // Create and buffer the config events and `num_events_before_log_start`
+  // Create and buffer the config events and `num_events_before_start`
   // randomized non-config events. Then call StartLogging and finally create and
   // write the remaining non-config events.
-  void WriteLog(EventCounts count, size_t num_events_before_log_start);
+  void WriteLog(EventCounts count, size_t num_events_before_start);
   void ReadAndVerifyLog();
 
   bool IsNewFormat() {