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

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

Issue 1157843002: 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, const char* message) { 36 void LogMessage(MojoLogLevel log_level,
37 const char* source_file,
38 uint32_t source_line,
39 const char* message) {
37 int chromium_log_level = MojoToChromiumLogLevel(log_level); 40 int chromium_log_level = MojoToChromiumLogLevel(log_level);
38 int chromium_min_log_level = logging::GetMinLogLevel(); 41 int chromium_min_log_level = logging::GetMinLogLevel();
39 // "Fatal" errors aren't suppressable. 42 // "Fatal" errors aren't suppressable.
40 DCHECK_LE(chromium_min_log_level, logging::LOG_FATAL); 43 DCHECK_LE(chromium_min_log_level, logging::LOG_FATAL);
41 if (chromium_log_level < chromium_min_log_level) 44 if (chromium_log_level < chromium_min_log_level)
42 return; 45 return;
43 46
44 // TODO(vtl): Possibly, we should try to pull out the file and line number 47 // TODO(vtl): Possibly, we should try to pull out the file and line number
45 // from |message|. 48 // from |message|.
46 logging::LogMessage(__FILE__, __LINE__, chromium_log_level).stream() 49 logging::LogMessage(__FILE__, __LINE__, chromium_log_level).stream()
(...skipping 15 matching lines...) Expand all
62 }; 65 };
63 66
64 } // namespace 67 } // namespace
65 68
66 const MojoLogger* GetDefaultLoggerImpl() { 69 const MojoLogger* GetDefaultLoggerImpl() {
67 return &kDefaultLogger; 70 return &kDefaultLogger;
68 } 71 }
69 72
70 } // namespace internal 73 } // namespace internal
71 } // namespace mojo 74 } // 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