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

Side by Side Diff: 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: Updated 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2012 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2012 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 20 matching lines...) Expand all
31 31
32 #include "third_party/webrtc/overrides/webrtc/base/diagnostic_logging.h" 32 #include "third_party/webrtc/overrides/webrtc/base/diagnostic_logging.h"
33 33
34 ////////////////////////////////////////////////////////////////////// 34 //////////////////////////////////////////////////////////////////////
35 // Libjingle macros which are mapped over to their VLOG equivalent in 35 // Libjingle macros which are mapped over to their VLOG equivalent in
36 // base/logging.h 36 // base/logging.h
37 ////////////////////////////////////////////////////////////////////// 37 //////////////////////////////////////////////////////////////////////
38 38
39 #if defined(LOGGING_INSIDE_WEBRTC) 39 #if defined(LOGGING_INSIDE_WEBRTC)
40 40
41 #define WEBRTC_VLOG_IS_ON(sev) VLOG_IS_ON(rtc::WebRtcVerbosityLevel(sev)) 41 namespace rtc {
42
43 // Note that |N| is the size *with* the null terminator.
44 bool CheckVlogIsOnHelper(LoggingSeverity severity,
45 const char* file, size_t N);
46
47 template <size_t N>
48 bool CheckVlogIsOn(LoggingSeverity severity, const char (&file)[N]) {
49 return CheckVlogIsOnHelper(severity, file, N);
50 }
51
52 } // namespace rtc
42 53
43 #define DIAGNOSTIC_LOG(sev, ctx, err, ...) \ 54 #define DIAGNOSTIC_LOG(sev, ctx, err, ...) \
44 rtc::DiagnosticLogMessage( \ 55 rtc::DiagnosticLogMessage( \
45 __FILE__, __LINE__, sev, WEBRTC_VLOG_IS_ON(sev), \ 56 __FILE__, __LINE__, sev, rtc::ERRCTX_ ## ctx, err, ##__VA_ARGS__).stream()
46 rtc::ERRCTX_ ## ctx, err, ##__VA_ARGS__).stream()
47 57
48 #define LOG_RTC_CHECK_LEVEL(sev) WEBRTC_VLOG_IS_ON(rtc::sev) 58 #define LOG_RTC_CHECK_LEVEL(sev) CheckVlogIsOn(rtc::sev, __FILE__)
49 #define LOG_RTC_CHECK_LEVEL_V(sev) WEBRTC_VLOG_IS_ON(sev) 59 #define LOG_RTC_CHECK_LEVEL_V(sev) CheckVlogIsOn(sev, __FILE__)
50 60
51 #define LOG_V(sev) DIAGNOSTIC_LOG(sev, NONE, 0) 61 #define LOG_V(sev) DIAGNOSTIC_LOG(sev, NONE, 0)
52 #undef LOG 62 #undef LOG
53 #define LOG(sev) DIAGNOSTIC_LOG(rtc::sev, NONE, 0) 63 #define LOG(sev) DIAGNOSTIC_LOG(rtc::sev, NONE, 0)
54 64
55 // The _F version prefixes the message with the current function name. 65 // The _F version prefixes the message with the current function name.
56 #if defined(__GNUC__) && defined(_DEBUG) 66 #if defined(__GNUC__) && defined(_DEBUG)
57 #define LOG_F(sev) LOG(sev) << __PRETTY_FUNCTION__ << ": " 67 #define LOG_F(sev) LOG(sev) << __PRETTY_FUNCTION__ << ": "
58 #else 68 #else
59 #define LOG_F(sev) LOG(sev) << __FUNCTION__ << ": " 69 #define LOG_F(sev) LOG(sev) << __FUNCTION__ << ": "
(...skipping 19 matching lines...) Expand all
79 #define LOG_ERR(sev) LOG_ERRNO(sev) 89 #define LOG_ERR(sev) LOG_ERRNO(sev)
80 #define LAST_SYSTEM_ERROR (errno) 90 #define LAST_SYSTEM_ERROR (errno)
81 #endif // OS_WIN 91 #endif // OS_WIN
82 92
83 #undef PLOG 93 #undef PLOG
84 #define PLOG(sev, err) LOG_ERR_EX(sev, err) 94 #define PLOG(sev, err) LOG_ERR_EX(sev, err)
85 95
86 #endif // LOGGING_INSIDE_WEBRTC 96 #endif // LOGGING_INSIDE_WEBRTC
87 97
88 #endif // THIRD_PARTY_LIBJINGLE_OVERRIDES_WEBRTC_BASE_LOGGING_H_ 98 #endif // THIRD_PARTY_LIBJINGLE_OVERRIDES_WEBRTC_BASE_LOGGING_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698