OLD | NEW |
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 Loading... |
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 |
OLD | NEW |