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

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

Issue 1157573002: Revert "Update mojo sdk to rev 1dc8a9a5db73d3718d99917fadf31f5fb2ebad4f" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | « mandoline/ui/aura/surface_binding.cc ('k') | mojo/runner/shell_apptest.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 15 matching lines...) Expand all
26 int MojoToChromiumLogLevel(MojoLogLevel log_level) { 26 int MojoToChromiumLogLevel(MojoLogLevel log_level) {
27 // See the compile asserts above. 27 // See the compile asserts above.
28 return static_cast<int>(log_level); 28 return static_cast<int>(log_level);
29 } 29 }
30 30
31 MojoLogLevel ChromiumToMojoLogLevel(int chromium_log_level) { 31 MojoLogLevel ChromiumToMojoLogLevel(int chromium_log_level) {
32 // See the compile asserts above. 32 // See the compile asserts above.
33 return static_cast<MojoLogLevel>(chromium_log_level); 33 return static_cast<MojoLogLevel>(chromium_log_level);
34 } 34 }
35 35
36 void LogMessage(MojoLogLevel log_level, 36 void LogMessage(MojoLogLevel log_level, const char* message) {
37 const char* source_file,
38 uint32_t source_line,
39 const char* message) {
40 int chromium_log_level = MojoToChromiumLogLevel(log_level); 37 int chromium_log_level = MojoToChromiumLogLevel(log_level);
41 int chromium_min_log_level = logging::GetMinLogLevel(); 38 int chromium_min_log_level = logging::GetMinLogLevel();
42 // "Fatal" errors aren't suppressable. 39 // "Fatal" errors aren't suppressable.
43 DCHECK_LE(chromium_min_log_level, logging::LOG_FATAL); 40 DCHECK_LE(chromium_min_log_level, logging::LOG_FATAL);
44 if (chromium_log_level < chromium_min_log_level) 41 if (chromium_log_level < chromium_min_log_level)
45 return; 42 return;
46 43
47 // 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
48 // from |message|. 45 // from |message|.
49 logging::LogMessage(__FILE__, __LINE__, chromium_log_level).stream() 46 logging::LogMessage(__FILE__, __LINE__, chromium_log_level).stream()
(...skipping 15 matching lines...) Expand all
65 }; 62 };
66 63
67 } // namespace 64 } // namespace
68 65
69 const MojoLogger* GetDefaultLoggerImpl() { 66 const MojoLogger* GetDefaultLoggerImpl() {
70 return &kDefaultLogger; 67 return &kDefaultLogger;
71 } 68 }
72 69
73 } // namespace internal 70 } // namespace internal
74 } // namespace mojo 71 } // namespace mojo
OLDNEW
« no previous file with comments | « mandoline/ui/aura/surface_binding.cc ('k') | mojo/runner/shell_apptest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698