OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "base/logging_win.h" | 5 #include "base/logging_win.h" |
6 #include "base/memory/singleton.h" | 6 #include "base/memory/singleton.h" |
7 #include <initguid.h> // NOLINT | 7 #include <initguid.h> // NOLINT |
8 | 8 |
9 namespace logging { | 9 namespace logging { |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 // Convert the log severity to the most appropriate ETW trace level. | 30 // Convert the log severity to the most appropriate ETW trace level. |
31 if (severity >= 0) { | 31 if (severity >= 0) { |
32 switch (severity) { | 32 switch (severity) { |
33 case LOG_INFO: | 33 case LOG_INFO: |
34 level = TRACE_LEVEL_INFORMATION; | 34 level = TRACE_LEVEL_INFORMATION; |
35 break; | 35 break; |
36 case LOG_WARNING: | 36 case LOG_WARNING: |
37 level = TRACE_LEVEL_WARNING; | 37 level = TRACE_LEVEL_WARNING; |
38 break; | 38 break; |
39 case LOG_ERROR: | 39 case LOG_ERROR: |
40 case LOG_ERROR_REPORT: | |
41 level = TRACE_LEVEL_ERROR; | 40 level = TRACE_LEVEL_ERROR; |
42 break; | 41 break; |
43 case LOG_FATAL: | 42 case LOG_FATAL: |
44 level = TRACE_LEVEL_FATAL; | 43 level = TRACE_LEVEL_FATAL; |
45 break; | 44 break; |
46 } | 45 } |
47 } else { // severity < 0 is VLOG verbosity levels. | 46 } else { // severity < 0 is VLOG verbosity levels. |
48 level = TRACE_LEVEL_INFORMATION - severity; | 47 level = TRACE_LEVEL_INFORMATION - severity; |
49 } | 48 } |
50 | 49 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 SetMinLogLevel(TRACE_LEVEL_INFORMATION - level); | 129 SetMinLogLevel(TRACE_LEVEL_INFORMATION - level); |
131 } | 130 } |
132 } | 131 } |
133 | 132 |
134 void LogEventProvider::OnEventsDisabled() { | 133 void LogEventProvider::OnEventsDisabled() { |
135 // Restore the old log level. | 134 // Restore the old log level. |
136 SetMinLogLevel(old_log_level_); | 135 SetMinLogLevel(old_log_level_); |
137 } | 136 } |
138 | 137 |
139 } // namespace logging | 138 } // namespace logging |
OLD | NEW |