Improves logging in MediaChannel
This CL changes the style of logging for an API which is essential when WebRTC is used in Chrome. By changing the format, we can more easily tie in (search for tags etc.) logs from WebRTC with logs in Chrome. See e.g. https://chromium-review.googlesource.com/c/chromium/src/+/2093443 for more details. I decided to use a new private method to avoid using rtc::StringBuilder. The idea was to make the log statements less complex and more condensed. Tbr: mbonadei Bug: webrtc:11493 Change-Id: I46b4a933ad62ac1db376743b4a41b62c5f8c6ac6 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/172841 Commit-Queue: Henrik Andreassson <henrika@webrtc.org> Reviewed-by: Henrik Andreassson <henrika@webrtc.org> Cr-Commit-Position: refs/heads/master@{#31808}
This commit is contained in:
committed by
Henrik Andreassson
parent
3ea3e0c345
commit
c6cf902034
@ -22,6 +22,7 @@
|
||||
#include "rtc_base/location.h"
|
||||
#include "rtc_base/logging.h"
|
||||
#include "rtc_base/numerics/safe_conversions.h"
|
||||
#include "rtc_base/strings/string_format.h"
|
||||
#include "rtc_base/thread.h"
|
||||
#include "rtc_base/thread_checker.h"
|
||||
|
||||
@ -102,6 +103,8 @@ bool RemoteAudioSource::remote() const {
|
||||
void RemoteAudioSource::SetVolume(double volume) {
|
||||
RTC_DCHECK_GE(volume, 0);
|
||||
RTC_DCHECK_LE(volume, 10);
|
||||
RTC_LOG(LS_INFO) << rtc::StringFormat("RAS::%s({volume=%.2f})", __func__,
|
||||
volume);
|
||||
for (auto* observer : audio_observers_) {
|
||||
observer->OnSetVolume(volume);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user