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 <kwiberg@webrtc.org>
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24597}
This commit is contained in:
Jonas Olsson 2018-09-06 09:50:23 +02:00 committed by Commit Bot
parent 8909a63aca
commit 8a7916b3f8

View File

@ -531,13 +531,13 @@ class LogMessage {
? static_cast<void>(0) \
: rtc::webrtc_logging_impl::LogMessageVoidify()&
#define RTC_LOG(sev) \
for (bool do_log = rtc::LogMessage::Loggable<rtc::sev>(); 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<sev>(); 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) \