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}
diff --git a/examples/androidvoip/jni/android_voip_client.cc b/examples/androidvoip/jni/android_voip_client.cc
index 09234e4..6842702 100644
--- a/examples/androidvoip/jni/android_voip_client.cc
+++ b/examples/androidvoip/jni/android_voip_client.cc
@@ -64,7 +64,7 @@
std::unique_ptr<rtc::Socket> socket(
thread->socketserver()->CreateSocket(family, SOCK_DGRAM));
if (!socket) {
- RTC_LOG_ERR(LERROR) << "Socket creation failed";
+ RTC_LOG_ERR(LS_ERROR) << "Socket creation failed";
return rtc::IPAddress();
}
@@ -308,7 +308,7 @@
rtp_socket_.reset(rtc::AsyncUDPSocket::Create(voip_thread_->socketserver(),
rtp_local_address_));
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_,
/*isSuccessful=*/false);
return;
@@ -319,7 +319,7 @@
rtcp_socket_.reset(rtc::AsyncUDPSocket::Create(voip_thread_->socketserver(),
rtcp_local_address_));
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_,
/*isSuccessful=*/false);
return;
diff --git a/examples/unityplugin/simple_peer_connection.cc b/examples/unityplugin/simple_peer_connection.cc
index 4e16c00..0503a26 100644
--- a/examples/unityplugin/simple_peer_connection.cc
+++ b/examples/unityplugin/simple_peer_connection.cc
@@ -269,7 +269,7 @@
}
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
if (OnFailureMessage)
diff --git a/modules/audio_coding/acm2/acm_receiver.cc b/modules/audio_coding/acm2/acm_receiver.cc
index 6d9211c..aa98169 100644
--- a/modules/audio_coding/acm2/acm_receiver.cc
+++ b/modules/audio_coding/acm2/acm_receiver.cc
@@ -66,14 +66,14 @@
int AcmReceiver::SetMinimumDelay(int delay_ms) {
if (neteq_->SetMinimumDelay(delay_ms))
return 0;
- RTC_LOG(LERROR) << "AcmReceiver::SetExtraDelay " << delay_ms;
+ RTC_LOG(LS_ERROR) << "AcmReceiver::SetExtraDelay " << delay_ms;
return -1;
}
int AcmReceiver::SetMaximumDelay(int delay_ms) {
if (neteq_->SetMaximumDelay(delay_ms))
return 0;
- RTC_LOG(LERROR) << "AcmReceiver::SetExtraDelay " << delay_ms;
+ RTC_LOG(LS_ERROR) << "AcmReceiver::SetExtraDelay " << delay_ms;
return -1;
}
@@ -134,9 +134,9 @@
} // `mutex_` is released.
if (neteq_->InsertPacket(rtp_header, incoming_payload) < 0) {
- RTC_LOG(LERROR) << "AcmReceiver::InsertPacket "
- << static_cast<int>(rtp_header.payloadType)
- << " Failed to insert packet";
+ RTC_LOG(LS_ERROR) << "AcmReceiver::InsertPacket "
+ << static_cast<int>(rtp_header.payloadType)
+ << " Failed to insert packet";
return -1;
}
return 0;
@@ -150,7 +150,7 @@
int current_sample_rate_hz = 0;
if (neteq_->GetAudio(audio_frame, muted, ¤t_sample_rate_hz) !=
NetEq::kOK) {
- RTC_LOG(LERROR) << "AcmReceiver::GetAudio - NetEq Failed.";
+ RTC_LOG(LS_ERROR) << "AcmReceiver::GetAudio - NetEq Failed.";
return -1;
}
@@ -170,8 +170,8 @@
audio_frame->num_channels_, AudioFrame::kMaxDataSizeSamples,
temp_output);
if (samples_per_channel_int < 0) {
- RTC_LOG(LERROR) << "AcmReceiver::GetAudio - "
- "Resampling last_audio_buffer_ failed.";
+ RTC_LOG(LS_ERROR) << "AcmReceiver::GetAudio - "
+ "Resampling last_audio_buffer_ failed.";
return -1;
}
}
@@ -185,7 +185,7 @@
audio_frame->num_channels_, AudioFrame::kMaxDataSizeSamples,
audio_frame->mutable_data());
if (samples_per_channel_int < 0) {
- RTC_LOG(LERROR)
+ RTC_LOG(LS_ERROR)
<< "AcmReceiver::GetAudio - Resampling audio_buffer_ failed.";
return -1;
}
diff --git a/modules/audio_device/audio_device_impl.cc b/modules/audio_device/audio_device_impl.cc
index 9d540f9..200259a 100644
--- a/modules/audio_device/audio_device_impl.cc
+++ b/modules/audio_device/audio_device_impl.cc
@@ -142,7 +142,7 @@
RTC_LOG(LS_INFO) << "current platform is Mac";
#endif
if (platform == kPlatformNotSupported) {
- RTC_LOG(LERROR)
+ RTC_LOG(LS_ERROR)
<< "current platform is not supported => this module will self "
"destruct!";
return -1;
@@ -546,7 +546,7 @@
RTC_LOG(LS_INFO) << __FUNCTION__ << "(" << enable << ")";
CHECKinitialized_();
if (audio_device_->RecordingIsInitialized()) {
- RTC_LOG(LERROR)
+ RTC_LOG(LS_ERROR)
<< "unable to set stereo mode after recording is initialized";
return -1;
}
@@ -592,7 +592,7 @@
RTC_LOG(LS_INFO) << __FUNCTION__ << "(" << enable << ")";
CHECKinitialized_();
if (audio_device_->PlayoutIsInitialized()) {
- RTC_LOG(LERROR)
+ RTC_LOG(LS_ERROR)
<< "unable to set stereo mode while playing side is initialized";
return -1;
}
@@ -856,7 +856,7 @@
CHECKinitialized_();
uint16_t delay = 0;
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;
}
*delayMS = delay;
diff --git a/p2p/base/stun_port.cc b/p2p/base/stun_port.cc
index 1ebd15e..c9fbefdc 100644
--- a/p2p/base/stun_port.cc
+++ b/p2p/base/stun_port.cc
@@ -577,7 +577,7 @@
options.info_signaled_after_sent.packet_type = rtc::PacketType::kStunMessage;
CopyPortInformationToPacketInfo(&options.info_signaled_after_sent);
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 "
<< sreq->server_addr().ToSensitiveString() << " ("
<< sreq->server_addr().ToResolvedSensitiveString()
diff --git a/p2p/base/stun_request.cc b/p2p/base/stun_request.cc
index b271daa..09a7a83 100644
--- a/p2p/base/stun_request.cc
+++ b/p2p/base/stun_request.cc
@@ -147,9 +147,9 @@
} else if (msg->type() == GetStunErrorResponseType(request->type())) {
request->OnErrorResponse(msg);
} else {
- RTC_LOG(LERROR) << "Received response with wrong type: " << msg->type()
- << " (expecting "
- << GetStunSuccessResponseType(request->type()) << ")";
+ RTC_LOG(LS_ERROR) << "Received response with wrong type: " << msg->type()
+ << " (expecting "
+ << GetStunSuccessResponseType(request->type()) << ")";
return false;
}
diff --git a/rtc_base/logging.h b/rtc_base/logging.h
index b6fdf9c..98729ef 100644
--- a/rtc_base/logging.h
+++ b/rtc_base/logging.h
@@ -94,8 +94,7 @@
INFO [[deprecated("Use LS_INFO")]] = LS_INFO,
// WARNING [[deprecated("Use LS_WARNING")]] = LS_WARNING,
WARNING = LS_WARNING,
- // LERROR [[deprecated("Use LS_ERROR")]] = LS_ERROR
- LERROR = LS_ERROR
+ LERROR [[deprecated("Use LS_ERROR")]] = LS_ERROR
};
// LogErrorContext assists in interpreting the meaning of an error value.
diff --git a/rtc_base/network.cc b/rtc_base/network.cc
index dbcdcc4..eefee96 100644
--- a/rtc_base/network.cc
+++ b/rtc_base/network.cc
@@ -652,8 +652,8 @@
struct ifaddrs* interfaces;
int error = getifaddrs(&interfaces);
if (error != 0) {
- RTC_LOG_ERR(LERROR) << "getifaddrs failed to gather interface data: "
- << error;
+ RTC_LOG_ERR(LS_ERROR) << "getifaddrs failed to gather interface data: "
+ << error;
return false;
}
@@ -983,7 +983,7 @@
std::unique_ptr<Socket> socket(
socket_factory->CreateSocket(family, SOCK_DGRAM));
if (!socket) {
- RTC_LOG_ERR(LERROR) << "Socket creation failed";
+ RTC_LOG_ERR(LS_ERROR) << "Socket creation failed";
return IPAddress();
}
diff --git a/rtc_base/physical_socket_server.cc b/rtc_base/physical_socket_server.cc
index 040904a..61acf54 100644
--- a/rtc_base/physical_socket_server.cc
+++ b/rtc_base/physical_socket_server.cc
@@ -939,7 +939,7 @@
std::array<int, 2> afd = {-1, -1};
if (pipe(afd.data()) < 0) {
- RTC_LOG(LERROR) << "pipe failed";
+ RTC_LOG(LS_ERROR) << "pipe failed";
}
return afd;
}()),
diff --git a/sdk/objc/native/src/audio/audio_device_module_ios.mm b/sdk/objc/native/src/audio/audio_device_module_ios.mm
index db4ed21..d0049c3 100644
--- a/sdk/objc/native/src/audio/audio_device_module_ios.mm
+++ b/sdk/objc/native/src/audio/audio_device_module_ios.mm
@@ -324,8 +324,7 @@
RTC_DLOG(LS_INFO) << __FUNCTION__ << "(" << enable << ")";
CHECKinitialized_();
if (audio_device_->PlayoutIsInitialized()) {
- RTC_LOG(LERROR)
- << "unable to set stereo mode while playing side is initialized";
+ RTC_LOG(LS_ERROR) << "unable to set stereo mode while playing side is initialized";
return -1;
}
if (audio_device_->SetStereoPlayout(enable)) {
@@ -588,7 +587,7 @@
CHECKinitialized_();
uint16_t delay = 0;
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;
}
*delayMS = delay;