Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1023)

Unified Diff: webrtc/overrides/webrtc/base/logging.h

Issue 1338763002: Remove dependency on Chromium in diagnostic_logging.h. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc/trunk/webrtc.git@rename_checks
Patch Set: Added bug in comment. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/overrides/webrtc/base/diagnostic_logging.h ('k') | webrtc/overrides/webrtc/base/logging.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/overrides/webrtc/base/logging.h
diff --git a/webrtc/overrides/webrtc/base/logging.h b/webrtc/overrides/webrtc/base/logging.h
index ef471ee5e56076e22ef395733244794be33a5a0b..43de221e18d3964f4a799a374d13d17448d41666 100644
--- a/webrtc/overrides/webrtc/base/logging.h
+++ b/webrtc/overrides/webrtc/base/logging.h
@@ -38,15 +38,25 @@
#if defined(LOGGING_INSIDE_WEBRTC)
-#define WEBRTC_VLOG_IS_ON(sev) VLOG_IS_ON(rtc::WebRtcVerbosityLevel(sev))
+namespace rtc {
+
+// Note that |N| is the size *with* the null terminator.
+bool CheckVlogIsOnHelper(LoggingSeverity severity,
+ const char* file, size_t N);
+
+template <size_t N>
+bool CheckVlogIsOn(LoggingSeverity severity, const char (&file)[N]) {
+ return CheckVlogIsOnHelper(severity, file, N);
+}
+
+} // namespace rtc
#define DIAGNOSTIC_LOG(sev, ctx, err, ...) \
rtc::DiagnosticLogMessage( \
- __FILE__, __LINE__, sev, WEBRTC_VLOG_IS_ON(sev), \
- rtc::ERRCTX_ ## ctx, err, ##__VA_ARGS__).stream()
+ __FILE__, __LINE__, sev, rtc::ERRCTX_ ## ctx, err, ##__VA_ARGS__).stream()
-#define LOG_CHECK_LEVEL(sev) WEBRTC_VLOG_IS_ON(rtc::sev)
-#define LOG_CHECK_LEVEL_V(sev) WEBRTC_VLOG_IS_ON(sev)
+#define LOG_CHECK_LEVEL(sev) CheckVlogIsOn(rtc::sev, __FILE__)
+#define LOG_CHECK_LEVEL_V(sev) CheckVlogIsOn(sev, __FILE__)
#define LOG_V(sev) DIAGNOSTIC_LOG(sev, NONE, 0)
#undef LOG
« no previous file with comments | « webrtc/overrides/webrtc/base/diagnostic_logging.h ('k') | webrtc/overrides/webrtc/base/logging.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698