OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 // Need to include this before most other files because it defines | 7 // Need to include this before most other files because it defines |
8 // IPC_MESSAGE_LOG_ENABLED. We need to use it to define | 8 // IPC_MESSAGE_LOG_ENABLED. We need to use it to define |
9 // IPC_MESSAGE_MACROS_LOG_ENABLED so render_messages.h will generate the | 9 // IPC_MESSAGE_MACROS_LOG_ENABLED so render_messages.h will generate the |
10 // ViewMsgLog et al. functions. | 10 // ViewMsgLog et al. functions. |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 DCHECK(!chrome_logging_initialized_) << | 93 DCHECK(!chrome_logging_initialized_) << |
94 "Attempted to initialize logging when it was already initialized."; | 94 "Attempted to initialize logging when it was already initialized."; |
95 | 95 |
96 #if defined(OS_POSIX) && defined(IPC_MESSAGE_LOG_ENABLED) | 96 #if defined(OS_POSIX) && defined(IPC_MESSAGE_LOG_ENABLED) |
97 IPC::Logging::SetLoggerFunctions(g_log_function_mapping); | 97 IPC::Logging::SetLoggerFunctions(g_log_function_mapping); |
98 #endif | 98 #endif |
99 | 99 |
100 // only use OutputDebugString in debug mode | 100 // only use OutputDebugString in debug mode |
101 #ifdef NDEBUG | 101 #ifdef NDEBUG |
102 bool enable_logging = false; | 102 bool enable_logging = false; |
103 const wchar_t *kInvertLoggingSwitch = switches::kEnableLogging; | 103 const char *kInvertLoggingSwitch = switches::kEnableLogging; |
104 const logging::LoggingDestination kDefaultLoggingMode = | 104 const logging::LoggingDestination kDefaultLoggingMode = |
105 logging::LOG_ONLY_TO_FILE; | 105 logging::LOG_ONLY_TO_FILE; |
106 #else | 106 #else |
107 bool enable_logging = true; | 107 bool enable_logging = true; |
108 const wchar_t *kInvertLoggingSwitch = switches::kDisableLogging; | 108 const char *kInvertLoggingSwitch = switches::kDisableLogging; |
109 const logging::LoggingDestination kDefaultLoggingMode = | 109 const logging::LoggingDestination kDefaultLoggingMode = |
110 logging::LOG_TO_BOTH_FILE_AND_SYSTEM_DEBUG_LOG; | 110 logging::LOG_TO_BOTH_FILE_AND_SYSTEM_DEBUG_LOG; |
111 #endif | 111 #endif |
112 | 112 |
113 if (command_line.HasSwitch(kInvertLoggingSwitch)) | 113 if (command_line.HasSwitch(kInvertLoggingSwitch)) |
114 enable_logging = !enable_logging; | 114 enable_logging = !enable_logging; |
115 | 115 |
116 logging::LoggingDestination log_mode; | 116 logging::LoggingDestination log_mode; |
117 if (enable_logging) { | 117 if (enable_logging) { |
118 // Let --enable-logging=stderr force only stderr, particularly useful for | 118 // Let --enable-logging=stderr force only stderr, particularly useful for |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 assertions->push_back(wide_line); | 213 assertions->push_back(wide_line); |
214 ++assertion_count; | 214 ++assertion_count; |
215 } | 215 } |
216 } | 216 } |
217 log_file.close(); | 217 log_file.close(); |
218 | 218 |
219 return assertion_count; | 219 return assertion_count; |
220 } | 220 } |
221 | 221 |
222 } // namespace logging | 222 } // namespace logging |
OLD | NEW |