Declare LERROR deprecated and remove all usage in webrtc

Bug: webrtc:13362
Change-Id: I1c6c6eccd950d73be616b34f96db7832ff94377e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/238804
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35416}
This commit is contained in:
Harald Alvestrand 2021-11-24 10:01:32 +00:00 committed by WebRTC LUCI CQ
parent 4e8e36c745
commit 5f34130f26
10 changed files with 28 additions and 30 deletions

View file

@ -64,7 +64,7 @@ rtc::IPAddress QueryDefaultLocalAddress(int family) {
std::unique_ptr<rtc::Socket> socket( std::unique_ptr<rtc::Socket> socket(
thread->socketserver()->CreateSocket(family, SOCK_DGRAM)); thread->socketserver()->CreateSocket(family, SOCK_DGRAM));
if (!socket) { if (!socket) {
RTC_LOG_ERR(LERROR) << "Socket creation failed"; RTC_LOG_ERR(LS_ERROR) << "Socket creation failed";
return rtc::IPAddress(); return rtc::IPAddress();
} }
@ -308,7 +308,7 @@ void AndroidVoipClient::StartSession(JNIEnv* env) {
rtp_socket_.reset(rtc::AsyncUDPSocket::Create(voip_thread_->socketserver(), rtp_socket_.reset(rtc::AsyncUDPSocket::Create(voip_thread_->socketserver(),
rtp_local_address_)); rtp_local_address_));
if (!rtp_socket_) { if (!rtp_socket_) {
RTC_LOG_ERR(LERROR) << "Socket creation failed"; RTC_LOG_ERR(LS_ERROR) << "Socket creation failed";
Java_VoipClient_onStartSessionCompleted(env_, j_voip_client_, Java_VoipClient_onStartSessionCompleted(env_, j_voip_client_,
/*isSuccessful=*/false); /*isSuccessful=*/false);
return; return;
@ -319,7 +319,7 @@ void AndroidVoipClient::StartSession(JNIEnv* env) {
rtcp_socket_.reset(rtc::AsyncUDPSocket::Create(voip_thread_->socketserver(), rtcp_socket_.reset(rtc::AsyncUDPSocket::Create(voip_thread_->socketserver(),
rtcp_local_address_)); rtcp_local_address_));
if (!rtcp_socket_) { if (!rtcp_socket_) {
RTC_LOG_ERR(LERROR) << "Socket creation failed"; RTC_LOG_ERR(LS_ERROR) << "Socket creation failed";
Java_VoipClient_onStartSessionCompleted(env_, j_voip_client_, Java_VoipClient_onStartSessionCompleted(env_, j_voip_client_,
/*isSuccessful=*/false); /*isSuccessful=*/false);
return; return;

View file

@ -269,7 +269,7 @@ void SimplePeerConnection::OnSuccess(
} }
void SimplePeerConnection::OnFailure(webrtc::RTCError error) { void SimplePeerConnection::OnFailure(webrtc::RTCError error) {
RTC_LOG(LERROR) << ToString(error.type()) << ": " << error.message(); RTC_LOG(LS_ERROR) << ToString(error.type()) << ": " << error.message();
// TODO(hta): include error.type in the message // TODO(hta): include error.type in the message
if (OnFailureMessage) if (OnFailureMessage)

View file

@ -66,14 +66,14 @@ AcmReceiver::~AcmReceiver() = default;
int AcmReceiver::SetMinimumDelay(int delay_ms) { int AcmReceiver::SetMinimumDelay(int delay_ms) {
if (neteq_->SetMinimumDelay(delay_ms)) if (neteq_->SetMinimumDelay(delay_ms))
return 0; return 0;
RTC_LOG(LERROR) << "AcmReceiver::SetExtraDelay " << delay_ms; RTC_LOG(LS_ERROR) << "AcmReceiver::SetExtraDelay " << delay_ms;
return -1; return -1;
} }
int AcmReceiver::SetMaximumDelay(int delay_ms) { int AcmReceiver::SetMaximumDelay(int delay_ms) {
if (neteq_->SetMaximumDelay(delay_ms)) if (neteq_->SetMaximumDelay(delay_ms))
return 0; return 0;
RTC_LOG(LERROR) << "AcmReceiver::SetExtraDelay " << delay_ms; RTC_LOG(LS_ERROR) << "AcmReceiver::SetExtraDelay " << delay_ms;
return -1; return -1;
} }
@ -134,9 +134,9 @@ int AcmReceiver::InsertPacket(const RTPHeader& rtp_header,
} // `mutex_` is released. } // `mutex_` is released.
if (neteq_->InsertPacket(rtp_header, incoming_payload) < 0) { if (neteq_->InsertPacket(rtp_header, incoming_payload) < 0) {
RTC_LOG(LERROR) << "AcmReceiver::InsertPacket " RTC_LOG(LS_ERROR) << "AcmReceiver::InsertPacket "
<< static_cast<int>(rtp_header.payloadType) << static_cast<int>(rtp_header.payloadType)
<< " Failed to insert packet"; << " Failed to insert packet";
return -1; return -1;
} }
return 0; return 0;
@ -150,7 +150,7 @@ int AcmReceiver::GetAudio(int desired_freq_hz,
int current_sample_rate_hz = 0; int current_sample_rate_hz = 0;
if (neteq_->GetAudio(audio_frame, muted, &current_sample_rate_hz) != if (neteq_->GetAudio(audio_frame, muted, &current_sample_rate_hz) !=
NetEq::kOK) { NetEq::kOK) {
RTC_LOG(LERROR) << "AcmReceiver::GetAudio - NetEq Failed."; RTC_LOG(LS_ERROR) << "AcmReceiver::GetAudio - NetEq Failed.";
return -1; return -1;
} }
@ -170,8 +170,8 @@ int AcmReceiver::GetAudio(int desired_freq_hz,
audio_frame->num_channels_, AudioFrame::kMaxDataSizeSamples, audio_frame->num_channels_, AudioFrame::kMaxDataSizeSamples,
temp_output); temp_output);
if (samples_per_channel_int < 0) { if (samples_per_channel_int < 0) {
RTC_LOG(LERROR) << "AcmReceiver::GetAudio - " RTC_LOG(LS_ERROR) << "AcmReceiver::GetAudio - "
"Resampling last_audio_buffer_ failed."; "Resampling last_audio_buffer_ failed.";
return -1; return -1;
} }
} }
@ -185,7 +185,7 @@ int AcmReceiver::GetAudio(int desired_freq_hz,
audio_frame->num_channels_, AudioFrame::kMaxDataSizeSamples, audio_frame->num_channels_, AudioFrame::kMaxDataSizeSamples,
audio_frame->mutable_data()); audio_frame->mutable_data());
if (samples_per_channel_int < 0) { if (samples_per_channel_int < 0) {
RTC_LOG(LERROR) RTC_LOG(LS_ERROR)
<< "AcmReceiver::GetAudio - Resampling audio_buffer_ failed."; << "AcmReceiver::GetAudio - Resampling audio_buffer_ failed.";
return -1; return -1;
} }

View file

@ -142,7 +142,7 @@ int32_t AudioDeviceModuleImpl::CheckPlatform() {
RTC_LOG(LS_INFO) << "current platform is Mac"; RTC_LOG(LS_INFO) << "current platform is Mac";
#endif #endif
if (platform == kPlatformNotSupported) { if (platform == kPlatformNotSupported) {
RTC_LOG(LERROR) RTC_LOG(LS_ERROR)
<< "current platform is not supported => this module will self " << "current platform is not supported => this module will self "
"destruct!"; "destruct!";
return -1; return -1;
@ -546,7 +546,7 @@ int32_t AudioDeviceModuleImpl::SetStereoRecording(bool enable) {
RTC_LOG(LS_INFO) << __FUNCTION__ << "(" << enable << ")"; RTC_LOG(LS_INFO) << __FUNCTION__ << "(" << enable << ")";
CHECKinitialized_(); CHECKinitialized_();
if (audio_device_->RecordingIsInitialized()) { if (audio_device_->RecordingIsInitialized()) {
RTC_LOG(LERROR) RTC_LOG(LS_ERROR)
<< "unable to set stereo mode after recording is initialized"; << "unable to set stereo mode after recording is initialized";
return -1; return -1;
} }
@ -592,7 +592,7 @@ int32_t AudioDeviceModuleImpl::SetStereoPlayout(bool enable) {
RTC_LOG(LS_INFO) << __FUNCTION__ << "(" << enable << ")"; RTC_LOG(LS_INFO) << __FUNCTION__ << "(" << enable << ")";
CHECKinitialized_(); CHECKinitialized_();
if (audio_device_->PlayoutIsInitialized()) { if (audio_device_->PlayoutIsInitialized()) {
RTC_LOG(LERROR) RTC_LOG(LS_ERROR)
<< "unable to set stereo mode while playing side is initialized"; << "unable to set stereo mode while playing side is initialized";
return -1; return -1;
} }
@ -856,7 +856,7 @@ int32_t AudioDeviceModuleImpl::PlayoutDelay(uint16_t* delayMS) const {
CHECKinitialized_(); CHECKinitialized_();
uint16_t delay = 0; uint16_t delay = 0;
if (audio_device_->PlayoutDelay(delay) == -1) { if (audio_device_->PlayoutDelay(delay) == -1) {
RTC_LOG(LERROR) << "failed to retrieve the playout delay"; RTC_LOG(LS_ERROR) << "failed to retrieve the playout delay";
return -1; return -1;
} }
*delayMS = delay; *delayMS = delay;

View file

@ -577,7 +577,7 @@ void UDPPort::OnSendPacket(const void* data, size_t size, StunRequest* req) {
options.info_signaled_after_sent.packet_type = rtc::PacketType::kStunMessage; options.info_signaled_after_sent.packet_type = rtc::PacketType::kStunMessage;
CopyPortInformationToPacketInfo(&options.info_signaled_after_sent); CopyPortInformationToPacketInfo(&options.info_signaled_after_sent);
if (socket_->SendTo(data, size, sreq->server_addr(), options) < 0) { if (socket_->SendTo(data, size, sreq->server_addr(), options) < 0) {
RTC_LOG_ERR_EX(LERROR, socket_->GetError()) RTC_LOG_ERR_EX(LS_ERROR, socket_->GetError())
<< "UDP send of " << size << " bytes to host " << "UDP send of " << size << " bytes to host "
<< sreq->server_addr().ToSensitiveString() << " (" << sreq->server_addr().ToSensitiveString() << " ("
<< sreq->server_addr().ToResolvedSensitiveString() << sreq->server_addr().ToResolvedSensitiveString()

View file

@ -147,9 +147,9 @@ bool StunRequestManager::CheckResponse(StunMessage* msg) {
} else if (msg->type() == GetStunErrorResponseType(request->type())) { } else if (msg->type() == GetStunErrorResponseType(request->type())) {
request->OnErrorResponse(msg); request->OnErrorResponse(msg);
} else { } else {
RTC_LOG(LERROR) << "Received response with wrong type: " << msg->type() RTC_LOG(LS_ERROR) << "Received response with wrong type: " << msg->type()
<< " (expecting " << " (expecting "
<< GetStunSuccessResponseType(request->type()) << ")"; << GetStunSuccessResponseType(request->type()) << ")";
return false; return false;
} }

View file

@ -94,8 +94,7 @@ enum LoggingSeverity {
INFO [[deprecated("Use LS_INFO")]] = LS_INFO, INFO [[deprecated("Use LS_INFO")]] = LS_INFO,
// WARNING [[deprecated("Use LS_WARNING")]] = LS_WARNING, // WARNING [[deprecated("Use LS_WARNING")]] = LS_WARNING,
WARNING = LS_WARNING, WARNING = LS_WARNING,
// LERROR [[deprecated("Use LS_ERROR")]] = LS_ERROR LERROR [[deprecated("Use LS_ERROR")]] = LS_ERROR
LERROR = LS_ERROR
}; };
// LogErrorContext assists in interpreting the meaning of an error value. // LogErrorContext assists in interpreting the meaning of an error value.

View file

@ -652,8 +652,8 @@ bool BasicNetworkManager::CreateNetworks(bool include_ignored,
struct ifaddrs* interfaces; struct ifaddrs* interfaces;
int error = getifaddrs(&interfaces); int error = getifaddrs(&interfaces);
if (error != 0) { if (error != 0) {
RTC_LOG_ERR(LERROR) << "getifaddrs failed to gather interface data: " RTC_LOG_ERR(LS_ERROR) << "getifaddrs failed to gather interface data: "
<< error; << error;
return false; return false;
} }
@ -983,7 +983,7 @@ IPAddress BasicNetworkManager::QueryDefaultLocalAddress(int family) const {
std::unique_ptr<Socket> socket( std::unique_ptr<Socket> socket(
socket_factory->CreateSocket(family, SOCK_DGRAM)); socket_factory->CreateSocket(family, SOCK_DGRAM));
if (!socket) { if (!socket) {
RTC_LOG_ERR(LERROR) << "Socket creation failed"; RTC_LOG_ERR(LS_ERROR) << "Socket creation failed";
return IPAddress(); return IPAddress();
} }

View file

@ -939,7 +939,7 @@ class Signaler : public Dispatcher {
std::array<int, 2> afd = {-1, -1}; std::array<int, 2> afd = {-1, -1};
if (pipe(afd.data()) < 0) { if (pipe(afd.data()) < 0) {
RTC_LOG(LERROR) << "pipe failed"; RTC_LOG(LS_ERROR) << "pipe failed";
} }
return afd; return afd;
}()), }()),

View file

@ -324,8 +324,7 @@ AudioDeviceModuleIOS::AudioDeviceModuleIOS(bool bypass_voice_processing)
RTC_DLOG(LS_INFO) << __FUNCTION__ << "(" << enable << ")"; RTC_DLOG(LS_INFO) << __FUNCTION__ << "(" << enable << ")";
CHECKinitialized_(); CHECKinitialized_();
if (audio_device_->PlayoutIsInitialized()) { if (audio_device_->PlayoutIsInitialized()) {
RTC_LOG(LERROR) RTC_LOG(LS_ERROR) << "unable to set stereo mode while playing side is initialized";
<< "unable to set stereo mode while playing side is initialized";
return -1; return -1;
} }
if (audio_device_->SetStereoPlayout(enable)) { if (audio_device_->SetStereoPlayout(enable)) {
@ -588,7 +587,7 @@ AudioDeviceModuleIOS::AudioDeviceModuleIOS(bool bypass_voice_processing)
CHECKinitialized_(); CHECKinitialized_();
uint16_t delay = 0; uint16_t delay = 0;
if (audio_device_->PlayoutDelay(delay) == -1) { if (audio_device_->PlayoutDelay(delay) == -1) {
RTC_LOG(LERROR) << "failed to retrieve the playout delay"; RTC_LOG(LS_ERROR) << "failed to retrieve the playout delay";
return -1; return -1;
} }
*delayMS = delay; *delayMS = delay;