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

Side by Side Diff: base/logging_win.cc

Issue 596103002: Fix more disabled MSVC warnings, base/ edition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comment Created 6 years, 2 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
« no previous file with comments | « base/logging.cc ('k') | base/metrics/field_trial_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 26 matching lines...) Expand all
37 level = TRACE_LEVEL_WARNING; 37 level = TRACE_LEVEL_WARNING;
38 break; 38 break;
39 case LOG_ERROR: 39 case LOG_ERROR:
40 level = TRACE_LEVEL_ERROR; 40 level = TRACE_LEVEL_ERROR;
41 break; 41 break;
42 case LOG_FATAL: 42 case LOG_FATAL:
43 level = TRACE_LEVEL_FATAL; 43 level = TRACE_LEVEL_FATAL;
44 break; 44 break;
45 } 45 }
46 } else { // severity < 0 is VLOG verbosity levels. 46 } else { // severity < 0 is VLOG verbosity levels.
47 level = TRACE_LEVEL_INFORMATION - severity; 47 level = static_cast<EtwEventLevel>(TRACE_LEVEL_INFORMATION - severity);
48 } 48 }
49 49
50 // Bail if we're not logging, not at that level, 50 // Bail if we're not logging, not at that level,
51 // or if we're post-atexit handling. 51 // or if we're post-atexit handling.
52 LogEventProvider* provider = LogEventProvider::GetInstance(); 52 LogEventProvider* provider = LogEventProvider::GetInstance();
53 if (provider == NULL || level > provider->enable_level()) 53 if (provider == NULL || level > provider->enable_level())
54 return false; 54 return false;
55 55
56 // And now log the event. 56 // And now log the event.
57 if (provider->enable_flags() & ENABLE_LOG_MESSAGE_ONLY) { 57 if (provider->enable_flags() & ENABLE_LOG_MESSAGE_ONLY) {
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 SetMinLogLevel(TRACE_LEVEL_INFORMATION - level); 129 SetMinLogLevel(TRACE_LEVEL_INFORMATION - level);
130 } 130 }
131 } 131 }
132 132
133 void LogEventProvider::OnEventsDisabled() { 133 void LogEventProvider::OnEventsDisabled() {
134 // Restore the old log level. 134 // Restore the old log level.
135 SetMinLogLevel(old_log_level_); 135 SetMinLogLevel(old_log_level_);
136 } 136 }
137 137
138 } // namespace logging 138 } // namespace logging
OLDNEW
« no previous file with comments | « base/logging.cc ('k') | base/metrics/field_trial_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698