Update RTC_LOG macro so it can be used when called from xyz::rtc namespaces

Similar to earlier CL https://webrtc-review.googlesource.com/c/src/+/169683. While this is a rather specific use case and solution, currently these macros are using a mix of styles ever since https://webrtc-review.googlesource.com/c/src/+/184934. By switching to ::rtc we can ensure that the right namespace is used.

Bug: webrtc:11400
Change-Id: Id06f09b5224a399bd6b43bf0237422b24b5adfb1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/312980
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40490}
This commit is contained in:
Joachim Reiersen 2023-07-24 16:20:03 -04:00 committed by WebRTC LUCI CQ
parent 5eb521955a
commit d212551ad3

View file

@ -647,17 +647,17 @@ class LogMessage {
::rtc::webrtc_logging_impl::LogStreamer<>() \
<< ::rtc::webrtc_logging_impl::LogMetadata(file, line, sev)
#define RTC_LOG(sev) \
!rtc::LogMessage::IsNoop<::rtc::sev>() && \
#define RTC_LOG(sev) \
!::rtc::LogMessage::IsNoop<::rtc::sev>() && \
RTC_LOG_FILE_LINE(::rtc::sev, __FILE__, __LINE__)
#define RTC_LOG_IF(sev, condition) \
!rtc::LogMessage::IsNoop<::rtc::sev>() && (condition) && \
#define RTC_LOG_IF(sev, condition) \
!::rtc::LogMessage::IsNoop<::rtc::sev>() && (condition) && \
RTC_LOG_FILE_LINE(::rtc::sev, __FILE__, __LINE__)
// The _V version is for when a variable is passed in.
#define RTC_LOG_V(sev) \
!rtc::LogMessage::IsNoop(sev) && RTC_LOG_FILE_LINE(sev, __FILE__, __LINE__)
!::rtc::LogMessage::IsNoop(sev) && RTC_LOG_FILE_LINE(sev, __FILE__, __LINE__)
// The _F version prefixes the message with the current function name.
#if (defined(__GNUC__) && !defined(NDEBUG)) || defined(WANT_PRETTY_LOG_F)
@ -681,7 +681,7 @@ inline bool LogCheckLevel(LoggingSeverity sev) {
}
#define RTC_LOG_E(sev, ctx, err) \
!rtc::LogMessage::IsNoop<::rtc::sev>() && \
!::rtc::LogMessage::IsNoop<::rtc::sev>() && \
::rtc::webrtc_logging_impl::LogCall() & \
::rtc::webrtc_logging_impl::LogStreamer<>() \
<< ::rtc::webrtc_logging_impl::LogMetadataErr { \
@ -719,7 +719,7 @@ inline const char* AdaptString(const std::string& str) {
} // namespace webrtc_logging_impl
#define RTC_LOG_TAG(sev, tag) \
!rtc::LogMessage::IsNoop(sev) && \
!::rtc::LogMessage::IsNoop(sev) && \
::rtc::webrtc_logging_impl::LogCall() & \
::rtc::webrtc_logging_impl::LogStreamer<>() \
<< ::rtc::webrtc_logging_impl::LogMetadataTag { \