From 4be7fbb81e4ee1153a7b8dbf9bc54337692dd8ce Mon Sep 17 00:00:00 2001 From: Tommi Date: Mon, 31 Jan 2022 16:54:54 +0100 Subject: [PATCH] Change frequently run log statements in RtcEventLog to DLOG. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This substantially reduces the amount of text logged in release builds when running: rtc_unittests.exe --gtest_filter=*RtcEventLog* Bug: none Change-Id: I7b7c7e66fa467924e4414f1d9bfc1590ff01e0c0 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249981 Reviewed-by: Björn Terelius Auto-Submit: Tomas Gunnarsson Commit-Queue: Tomas Gunnarsson Cr-Commit-Position: refs/heads/main@{#35859} --- logging/rtc_event_log/rtc_event_log_impl.cc | 11 +++++------ logging/rtc_event_log/rtc_event_log_parser.cc | 8 ++++---- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/logging/rtc_event_log/rtc_event_log_impl.cc b/logging/rtc_event_log/rtc_event_log_impl.cc index df59cba79b..0766b4a884 100644 --- a/logging/rtc_event_log/rtc_event_log_impl.cc +++ b/logging/rtc_event_log/rtc_event_log_impl.cc @@ -39,10 +39,10 @@ std::unique_ptr CreateEncoder( RtcEventLog::EncodingType type) { switch (type) { case RtcEventLog::EncodingType::Legacy: - RTC_LOG(LS_INFO) << "Creating legacy encoder for RTC event log."; + RTC_DLOG(LS_INFO) << "Creating legacy encoder for RTC event log."; return std::make_unique(); case RtcEventLog::EncodingType::NewFormat: - RTC_LOG(LS_INFO) << "Creating new format encoder for RTC event log."; + RTC_DLOG(LS_INFO) << "Creating new format encoder for RTC event log."; return std::make_unique(); default: RTC_LOG(LS_ERROR) << "Unknown RtcEventLog encoder type (" << int(type) @@ -91,8 +91,7 @@ bool RtcEventLogImpl::StartLogging(std::unique_ptr output, const int64_t timestamp_us = rtc::TimeMillis() * 1000; const int64_t utc_time_us = rtc::TimeUTCMillis() * 1000; - RTC_LOG(LS_INFO) << "Starting WebRTC event log. (Timestamp, UTC) = " - "(" + RTC_LOG(LS_INFO) << "Starting WebRTC event log. (Timestamp, UTC) = (" << timestamp_us << ", " << utc_time_us << ")."; RTC_DCHECK_RUN_ON(&logging_state_checker_); @@ -113,7 +112,7 @@ bool RtcEventLogImpl::StartLogging(std::unique_ptr output, } void RtcEventLogImpl::StopLogging() { - RTC_LOG(LS_INFO) << "Stopping WebRTC event log."; + RTC_DLOG(LS_INFO) << "Stopping WebRTC event log."; // TODO(danilchap): Do not block current thread waiting on the task queue. // It might work for now, for current callers, but disallows caller to share // threads with the `task_queue_`. @@ -121,7 +120,7 @@ void RtcEventLogImpl::StopLogging() { StopLogging([&output_stopped]() { output_stopped.Set(); }); output_stopped.Wait(rtc::Event::kForever); - RTC_LOG(LS_INFO) << "WebRTC event log successfully stopped."; + RTC_DLOG(LS_INFO) << "WebRTC event log successfully stopped."; } void RtcEventLogImpl::StopLogging(std::function callback) { diff --git a/logging/rtc_event_log/rtc_event_log_parser.cc b/logging/rtc_event_log/rtc_event_log_parser.cc index 7e114a257c..3742aba50b 100644 --- a/logging/rtc_event_log/rtc_event_log_parser.cc +++ b/logging/rtc_event_log/rtc_event_log_parser.cc @@ -1664,13 +1664,13 @@ const RtpHeaderExtensionMap* ParsedRtcEventLog::GetRtpHeaderExtensionMap( } if (parse_unconfigured_header_extensions_ == UnconfiguredHeaderExtensions::kAttemptWebrtcDefaultConfig) { - RTC_LOG(LS_WARNING) << "Using default header extension map for SSRC " - << ssrc; + RTC_DLOG(LS_WARNING) << "Using default header extension map for SSRC " + << ssrc; extensions_maps.insert(std::make_pair(ssrc, default_extension_map_)); return &default_extension_map_; } - RTC_LOG(LS_WARNING) << "Not parsing header extensions for SSRC " << ssrc - << ". No header extension map found."; + RTC_DLOG(LS_WARNING) << "Not parsing header extensions for SSRC " << ssrc + << ". No header extension map found."; return nullptr; }