Commit 78d480c6 authored by Fredrik Solenberg's avatar Fredrik Solenberg Committed by Commit Bot

Introduce RTC_DLOG macro.

Bug: webrtc:8529
Change-Id: I78ae0de9078c128a7b44b12bc93aba7b9fa49a5d
Reviewed-on: https://chromium-review.googlesource.com/772918
Commit-Queue: Fredrik Solenberg <solenberg@chromium.org>
Reviewed-by: default avatarTommi <tommi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517166}
parent 4eb2364b
...@@ -90,6 +90,30 @@ bool CheckVlogIsOn(LoggingSeverity severity, const char (&file)[N]) { ...@@ -90,6 +90,30 @@ bool CheckVlogIsOn(LoggingSeverity severity, const char (&file)[N]) {
#undef RTC_PLOG #undef RTC_PLOG
#define RTC_PLOG(sev, err) RTC_LOG_ERR_EX(sev, err) #define RTC_PLOG(sev, err) RTC_LOG_ERR_EX(sev, err)
// The RTC_DLOG macros are equivalent to their RTC_LOG counterparts except that
// they only generate code in debug builds.
#if defined(NDEBUG) && !defined(DCHECK_ALWAYS_ON)
#define RTC_DLOG_IS_ON 0
#else
#define RTC_DLOG_IS_ON 1
#endif
#if RTC_DLOG_IS_ON
#define RTC_DLOG(sev) RTC_LOG(sev)
#define RTC_DLOG_V(sev) RTC_LOG_V(sev)
#define RTC_DLOG_F(sev) RTC_LOG_F(sev)
#else
#define RTC_DLOG_EAT_STREAM_PARAMS(sev) \
(true ? true : ((void)(rtc::sev), true)) \
? static_cast<void>(0) \
: rtc::LogMessageVoidify() & \
rtc::DiagnosticLogMessage(__FILE__, __LINE__, rtc::sev, \
rtc::ERRCTX_NONE, 0).stream()
#define RTC_DLOG(sev) RTC_DLOG_EAT_STREAM_PARAMS(sev)
#define RTC_DLOG_V(sev) RTC_DLOG_EAT_STREAM_PARAMS(sev)
#define RTC_DLOG_F(sev) RTC_DLOG_EAT_STREAM_PARAMS(sev)
#endif
#endif // LOGGING_INSIDE_WEBRTC #endif // LOGGING_INSIDE_WEBRTC
#endif // THIRD_PARTY_WEBRTC_OVERRIDES_WEBRTC_RTC_BASE_LOGGING_H_ #endif // THIRD_PARTY_WEBRTC_OVERRIDES_WEBRTC_RTC_BASE_LOGGING_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment