From 8a7916b3f8425a4b7e44652d2062fa346a600e67 Mon Sep 17 00:00:00 2001 From: Jonas Olsson Date: Thu, 6 Sep 2018 09:50:23 +0200 Subject: [PATCH] Add a LOG macro with customizable file name and line number. This enables us to migrate a internal project from depending on implementation details of our LOG macros. Bug: webrtc:9278 Change-Id: I41408aec40e26d2b55df58360f94f5ceaa57af4e Reviewed-on: https://webrtc-review.googlesource.com/98001 Reviewed-by: Karl Wiberg Commit-Queue: Jonas Olsson Cr-Commit-Position: refs/heads/master@{#24597} --- rtc_base/logging.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/rtc_base/logging.h b/rtc_base/logging.h index b5af95928b..f61ae539b9 100644 --- a/rtc_base/logging.h +++ b/rtc_base/logging.h @@ -531,13 +531,13 @@ class LogMessage { ? static_cast(0) \ : rtc::webrtc_logging_impl::LogMessageVoidify()& -#define RTC_LOG(sev) \ - for (bool do_log = rtc::LogMessage::Loggable(); do_log; \ - do_log = false) \ - rtc::webrtc_logging_impl::LogCall() & \ - rtc::webrtc_logging_impl::LogStreamer<>() \ - << rtc::webrtc_logging_impl::LogMetadata(__FILE__, __LINE__, \ - rtc::sev) +#define RTC_LOG_FILE_LINE(sev, file, line) \ + for (bool do_log = rtc::LogMessage::Loggable(); do_log; do_log = false) \ + rtc::webrtc_logging_impl::LogCall() & \ + rtc::webrtc_logging_impl::LogStreamer<>() \ + << rtc::webrtc_logging_impl::LogMetadata(__FILE__, __LINE__, sev) + +#define RTC_LOG(sev) RTC_LOG_FILE_LINE(rtc::sev, __FILE__, __LINE__) // The _V version is for when a variable is passed in. #define RTC_LOG_V(sev) \