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

Side by Side Diff: mojo/environment/default_logger_impl.cc

Issue 339403003: Mojo: Make GetDefault{AsyncWaiter,Logger} static methods of Environment. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « mojo/environment/default_logger.cc ('k') | mojo/environment/environment.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "mojo/environment/default_logger_impl.h" 5 #include "mojo/environment/default_logger_impl.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 9
10 namespace mojo { 10 namespace mojo {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 // TODO(vtl): Possibly, we should try to pull out the file and line number 44 // TODO(vtl): Possibly, we should try to pull out the file and line number
45 // from |message|. 45 // from |message|.
46 logging::LogMessage(__FILE__, __LINE__, chromium_log_level).stream() 46 logging::LogMessage(__FILE__, __LINE__, chromium_log_level).stream()
47 << message; 47 << message;
48 } 48 }
49 49
50 MojoLogLevel GetMinimumLogLevel() { 50 MojoLogLevel GetMinimumLogLevel() {
51 return ChromiumToMojoLogLevel(logging::GetMinLogLevel()); 51 return ChromiumToMojoLogLevel(logging::GetMinLogLevel());
52 } 52 }
53 53
54 void SetMinimumLogLevel(MojoLogLevel log_level) {
55 logging::SetMinLogLevel(MojoToChromiumLogLevel(log_level));
56 }
57
54 const MojoLogger kDefaultLogger = { 58 const MojoLogger kDefaultLogger = {
55 LogMessage, 59 LogMessage,
56 GetMinimumLogLevel 60 GetMinimumLogLevel,
61 SetMinimumLogLevel
57 }; 62 };
58 63
59 } // namespace 64 } // namespace
60 65
61 const MojoLogger* GetDefaultLoggerImpl() { 66 const MojoLogger* GetDefaultLoggerImpl() {
62 return &kDefaultLogger; 67 return &kDefaultLogger;
63 } 68 }
64 69
65 } // namespace internal 70 } // namespace internal
66 } // namespace mojo 71 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/environment/default_logger.cc ('k') | mojo/environment/environment.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698