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

Side by Side Diff: third_party/webrtc_overrides/webrtc/base/logging.h

Issue 1982643002: Fix backwards WebRTC-in-Chromium override and expose Chromium logging setup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ...and expose it even if !defined(LOGGING_INSIDE_WEBRTC) Created 4 years, 7 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file overrides the logging macros in WebRTC (webrtc/base/logging.h). 5 // This file overrides the logging macros in WebRTC (webrtc/base/logging.h).
6 // Instead of using WebRTC's logging implementation, the WebRTC macros are 6 // Instead of using WebRTC's logging implementation, the WebRTC macros are
7 // mapped to DIAGNOSTIC_LOGING. In it's implementation (DiagnosticLogMessage in 7 // mapped to DIAGNOSTIC_LOGING. In it's implementation (DiagnosticLogMessage in
8 // third_party/webrtc_overrides/webrtc/base/logging.h), the corresponding 8 // third_party/webrtc_overrides/webrtc/base/logging.h), the corresponding
9 // base/logging.h macros (e.g. Chromium's VLOG) are used. 9 // base/logging.h macros (e.g. Chromium's VLOG) are used.
10 // If this file is included outside of WebRTC/libjingle it should be included 10 // If this file is included outside of WebRTC/libjingle it should be included
11 // after base/logging.h (if any) or compiler error or unexpected behavior may 11 // after base/logging.h (if any) or compiler error or unexpected behavior may
12 // occur (macros that have the same name in WebRTC as in Chromium will use 12 // occur (macros that have the same name in WebRTC as in Chromium will use
13 // the WebRTC definition if this file is included first). 13 // the WebRTC definition if this file is included first).
14 14
15 // Setting the LoggingSeverity (and lower) that should be written to file should 15 // Setting the LoggingSeverity (and lower) that should be written to file should
16 // be done via command line by specifying the flags: 16 // be done via command line by specifying the flags:
17 // --vmodule or --v please see base/logging.h for details on how to use them. 17 // --vmodule or --v please see base/logging.h for details on how to use them.
18 // Specifying what file to write to is done using InitLogging also in 18 // Specifying what file to write to is done using InitLogging also in
19 // base/logging.h. 19 // base/logging.h.
20 20
21 // The macros and classes declared in here are not described as they are 21 // The macros and classes declared in here are not described as they are
22 // NOT TO BE USED outside of WebRTC/libjingle. 22 // NOT TO BE USED outside of WebRTC/libjingle.
23 23
24 #ifndef THIRD_PARTY_WEBRTC_OVERRIDES_WEBRTC_BASE_LOGGING_H_ 24 #ifndef THIRD_PARTY_WEBRTC_OVERRIDES_WEBRTC_BASE_LOGGING_H_
25 #define THIRD_PARTY_WEBRTC_OVERRIDES_WEBRTC_BASE_LOGGING_H_ 25 #define THIRD_PARTY_WEBRTC_OVERRIDES_WEBRTC_BASE_LOGGING_H_
26 26
27 #include "third_party/webrtc_overrides/webrtc/base/diagnostic_logging.h" 27 #include "third_party/webrtc_overrides/webrtc/base/diagnostic_logging.h"
28 28
29 // Chromium allows a minimum programmatically-set log level of -1
Henrik Grunell 2016/05/18 08:43:26 Explain that this function is only used when WebRT
katrielc 2016/05/18 09:06:42 I checked with phoglund@ and they don't plan to mo
Henrik Grunell 2016/05/18 09:29:32 Acknowledged.
30 // unless there is a command line set up with --v=x. This exposes
31 // those initialisation calls to WebRTC code.
32 namespace rtc {
33 void InitChromiumLoggingAndCommandLine();
34 }
35
29 ////////////////////////////////////////////////////////////////////// 36 //////////////////////////////////////////////////////////////////////
30 // WebRTC macros which in DiagnosticLogMessage are mapped over to 37 // WebRTC macros which in DiagnosticLogMessage are mapped over to
31 // their VLOG equivalent in base/logging.h. 38 // their VLOG equivalent in base/logging.h.
32 ////////////////////////////////////////////////////////////////////// 39 //////////////////////////////////////////////////////////////////////
33 40
34 #if defined(LOGGING_INSIDE_WEBRTC) 41 #if defined(LOGGING_INSIDE_WEBRTC)
35 42
36 #include <errno.h> 43 #include <errno.h>
37 44
38 namespace rtc { 45 namespace rtc {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 #define LOG_ERR(sev) LOG_ERRNO(sev) 93 #define LOG_ERR(sev) LOG_ERRNO(sev)
87 #define LAST_SYSTEM_ERROR (errno) 94 #define LAST_SYSTEM_ERROR (errno)
88 #endif // OS_WIN 95 #endif // OS_WIN
89 96
90 #undef PLOG 97 #undef PLOG
91 #define PLOG(sev, err) LOG_ERR_EX(sev, err) 98 #define PLOG(sev, err) LOG_ERR_EX(sev, err)
92 99
93 #endif // LOGGING_INSIDE_WEBRTC 100 #endif // LOGGING_INSIDE_WEBRTC
94 101
95 #endif // THIRD_PARTY_WEBRTC_OVERRIDES_WEBRTC_BASE_LOGGING_H_ 102 #endif // THIRD_PARTY_WEBRTC_OVERRIDES_WEBRTC_BASE_LOGGING_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698