| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/logging/init_logging.h" | 5 #include "mojo/logging/init_logging.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 | 9 |
| 10 namespace mojo { | 10 namespace mojo { |
| 11 namespace logging { | |
| 12 namespace { | 11 namespace { |
| 13 | 12 |
| 14 ::logging::LoggingDestination DetermineLogMode( | 13 ::logging::LoggingDestination DetermineLogMode( |
| 15 const base::CommandLine& command_line) { | 14 const base::CommandLine& command_line) { |
| 16 // only use OutputDebugString in debug mode | 15 // only use OutputDebugString in debug mode |
| 17 #if defined(NDEBUG) | 16 #if defined(NDEBUG) |
| 18 bool enable_logging = false; | 17 bool enable_logging = false; |
| 19 const char* kInvertLoggingSwitch = "enable-logging"; | 18 const char* kInvertLoggingSwitch = "enable-logging"; |
| 20 #else | 19 #else |
| 21 bool enable_logging = true; | 20 bool enable_logging = true; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 38 *base::CommandLine::ForCurrentProcess()); | 37 *base::CommandLine::ForCurrentProcess()); |
| 39 ::logging::InitLogging(settings); | 38 ::logging::InitLogging(settings); |
| 40 | 39 |
| 41 // we want process and thread IDs because we have a lot of things running | 40 // we want process and thread IDs because we have a lot of things running |
| 42 ::logging::SetLogItems(true, // enable_process_id | 41 ::logging::SetLogItems(true, // enable_process_id |
| 43 true, // enable_thread_id | 42 true, // enable_thread_id |
| 44 true, // enable_timestamp | 43 true, // enable_timestamp |
| 45 false); // enable_tickcount | 44 false); // enable_tickcount |
| 46 } | 45 } |
| 47 | 46 |
| 48 } // namespace logging | |
| 49 } // namespace mojo | 47 } // namespace mojo |
| OLD | NEW |