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/diagnostic_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: More comments and a new case(LS_NONE) 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 #ifndef THIRD_PARTY_WEBRTC_OVERRIDES_WEBRTC_BASE_DIAGNOSTIC_LOGGING_H_ 5 #ifndef THIRD_PARTY_WEBRTC_OVERRIDES_WEBRTC_BASE_DIAGNOSTIC_LOGGING_H_
6 #define THIRD_PARTY_WEBRTC_OVERRIDES_WEBRTC_BASE_DIAGNOSTIC_LOGGING_H_ 6 #define THIRD_PARTY_WEBRTC_OVERRIDES_WEBRTC_BASE_DIAGNOSTIC_LOGGING_H_
7 7
8 #include <sstream> 8 #include <sstream>
9 #include <string> 9 #include <string>
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 // Note that the non-standard LoggingSeverity aliases exist because they are 42 // Note that the non-standard LoggingSeverity aliases exist because they are
43 // still in broad use. The meanings of the levels are: 43 // still in broad use. The meanings of the levels are:
44 // LS_SENSITIVE: Information which should only be logged with the consent 44 // LS_SENSITIVE: Information which should only be logged with the consent
45 // of the user, due to privacy concerns. 45 // of the user, due to privacy concerns.
46 // LS_VERBOSE: This level is for data which we do not want to appear in the 46 // LS_VERBOSE: This level is for data which we do not want to appear in the
47 // normal debug log, but should appear in diagnostic logs. 47 // normal debug log, but should appear in diagnostic logs.
48 // LS_INFO: Chatty level used in debugging for all sorts of things, the default 48 // LS_INFO: Chatty level used in debugging for all sorts of things, the default
49 // in debug builds. 49 // in debug builds.
50 // LS_WARNING: Something that may warrant investigation. 50 // LS_WARNING: Something that may warrant investigation.
51 // LS_ERROR: Something that should not have occurred. 51 // LS_ERROR: Something that should not have occurred.
52 // LS_NONE: A level < LS_ERROR, used to disable logging.
52 // Note that LoggingSeverity is mapped over to chromiums verbosity levels where 53 // Note that LoggingSeverity is mapped over to chromiums verbosity levels where
53 // anything lower than or equal to the current verbosity level is written to 54 // anything lower than or equal to the current verbosity level is written to
54 // file which is the opposite of logging severity in libjingle where higher 55 // file which is the opposite of logging severity in libjingle where higher
55 // severity numbers than or equal to the current severity level are written to 56 // severity numbers than or equal to the current severity level are written to
56 // file. Also, note that the values are explicitly defined here for convenience 57 // file. Also, note that the values are explicitly defined here for convenience
57 // since the command line flag must be set using numerical values. 58 // since the command line flag must be set using numerical values.
59 //
60 // LS_NONE is present so we can LogToDebug(LS_NONE) i.e. for ordinal
61 // comparisons with other log levels.
62 //
58 // TODO(tommi): To keep things simple, we should just use the same values for 63 // TODO(tommi): To keep things simple, we should just use the same values for
59 // these constants as Chrome does. 64 // these constants as Chrome does.
60 enum LoggingSeverity { LS_ERROR = 1, 65 enum LoggingSeverity { LS_NONE = 0,
66 LS_ERROR = 1,
61 LS_WARNING = 2, 67 LS_WARNING = 2,
62 LS_INFO = 3, 68 LS_INFO = 3,
63 LS_VERBOSE = 4, 69 LS_VERBOSE = 4,
64 LS_SENSITIVE = 5, 70 LS_SENSITIVE = 5,
65 INFO = LS_INFO, 71 INFO = LS_INFO,
66 WARNING = LS_WARNING, 72 WARNING = LS_WARNING,
67 LERROR = LS_ERROR }; 73 LERROR = LS_ERROR };
68 74
69 // LogErrorContext assists in interpreting the meaning of an error value. 75 // LogErrorContext assists in interpreting the meaning of an error value.
70 enum LogErrorContext { 76 enum LogErrorContext {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 class LogMultilineState { 129 class LogMultilineState {
124 public: 130 public:
125 size_t unprintable_count_[2]; 131 size_t unprintable_count_[2];
126 LogMultilineState() { 132 LogMultilineState() {
127 unprintable_count_[0] = unprintable_count_[1] = 0; 133 unprintable_count_[0] = unprintable_count_[1] = 0;
128 } 134 }
129 }; 135 };
130 136
131 class LogMessage { 137 class LogMessage {
132 public: 138 public:
133 static void LogToDebug(int min_sev); 139 static void LogToDebug(LoggingSeverity min_sev);
134 }; 140 };
135 141
136 // When possible, pass optional state variable to track various data across 142 // When possible, pass optional state variable to track various data across
137 // multiple calls to LogMultiline. Otherwise, pass NULL. 143 // multiple calls to LogMultiline. Otherwise, pass NULL.
138 void LogMultiline(LoggingSeverity level, const char* label, bool input, 144 void LogMultiline(LoggingSeverity level, const char* label, bool input,
139 const void* data, size_t len, bool hex_mode, 145 const void* data, size_t len, bool hex_mode,
140 LogMultilineState* state); 146 LogMultilineState* state);
141 147
142 // TODO(grunell): Change name to InitDiagnosticLoggingDelegate or 148 // TODO(grunell): Change name to InitDiagnosticLoggingDelegate or
143 // InitDiagnosticLogging. Change also in init_webrtc.h/cc. 149 // InitDiagnosticLogging. Change also in init_webrtc.h/cc.
144 // TODO(grunell): typedef the delegate function. 150 // TODO(grunell): typedef the delegate function.
145 void InitDiagnosticLoggingDelegateFunction( 151 void InitDiagnosticLoggingDelegateFunction(
146 void (*delegate)(const std::string&)); 152 void (*delegate)(const std::string&));
147 153
148 void SetExtraLoggingInit( 154 void SetExtraLoggingInit(
149 void (*function)(void (*delegate)(const std::string&))); 155 void (*function)(void (*delegate)(const std::string&)));
150 156
151 } // namespace rtc 157 } // namespace rtc
152 158
153 #endif // THIRD_PARTY_WEBRTC_OVERRIDES_WEBRTC_BASE_DIAGNOSTIC_LOGGING_H_ 159 #endif // THIRD_PARTY_WEBRTC_OVERRIDES_WEBRTC_BASE_DIAGNOSTIC_LOGGING_H_
OLDNEW
« no previous file with comments | « no previous file | third_party/webrtc_overrides/webrtc/base/logging.h » ('j') | third_party/webrtc_overrides/webrtc/base/logging.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698