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

Side by Side Diff: base/logging_win.cc

Issue 2034393004: Allow multiple logging::LogMessage{Handler,Listener}s Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix installation_validator_unittest Created 4 years, 6 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 (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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 return false; 95 return false;
96 } 96 }
97 97
98 void LogEventProvider::Initialize(const GUID& provider_name) { 98 void LogEventProvider::Initialize(const GUID& provider_name) {
99 LogEventProvider* provider = LogEventProvider::GetInstance(); 99 LogEventProvider* provider = LogEventProvider::GetInstance();
100 100
101 provider->set_provider_name(provider_name); 101 provider->set_provider_name(provider_name);
102 provider->Register(); 102 provider->Register();
103 103
104 // Register our message handler with logging. 104 // Register our message handler with logging.
105 SetLogMessageHandler(LogMessage); 105 PushLogMessageHandler(LogMessage);
106 } 106 }
107 107
108 void LogEventProvider::Uninitialize() { 108 void LogEventProvider::Uninitialize() {
109 LogEventProvider::GetInstance()->Unregister(); 109 LogEventProvider::GetInstance()->Unregister();
110 } 110 }
111 111
112 void LogEventProvider::OnEventsEnabled() { 112 void LogEventProvider::OnEventsEnabled() {
113 // Grab the old log level so we can restore it later. 113 // Grab the old log level so we can restore it later.
114 old_log_level_ = GetMinLogLevel(); 114 old_log_level_ = GetMinLogLevel();
115 115
(...skipping 13 matching lines...) Expand all
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

Powered by Google App Engine
This is Rietveld 408576698