OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 // indicates the start of a new session. | 255 // indicates the start of a new session. |
256 FilePath target_path = SetUpSymlinkIfNeeded( | 256 FilePath target_path = SetUpSymlinkIfNeeded( |
257 log_path, delete_old_log_file == logging::DELETE_OLD_LOG_FILE); | 257 log_path, delete_old_log_file == logging::DELETE_OLD_LOG_FILE); |
258 | 258 |
259 // Because ChromeOS manages the move to a new session by redirecting | 259 // Because ChromeOS manages the move to a new session by redirecting |
260 // the link, it shouldn't remove the old file in the logging code, | 260 // the link, it shouldn't remove the old file in the logging code, |
261 // since that will remove the newly created link instead. | 261 // since that will remove the newly created link instead. |
262 delete_old_log_file = logging::APPEND_TO_OLD_LOG_FILE; | 262 delete_old_log_file = logging::APPEND_TO_OLD_LOG_FILE; |
263 #endif | 263 #endif |
264 | 264 |
| 265 logging::DcheckState dcheck_state = |
| 266 command_line.HasSwitch(switches::kEnableDCHECK) ? |
| 267 logging::ENABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS : |
| 268 logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS; |
| 269 |
265 bool success = InitLogging(log_path.value().c_str(), | 270 bool success = InitLogging(log_path.value().c_str(), |
266 DetermineLogMode(command_line), | 271 DetermineLogMode(command_line), |
267 logging::LOCK_LOG_FILE, | 272 logging::LOCK_LOG_FILE, |
268 delete_old_log_file); | 273 delete_old_log_file, |
| 274 dcheck_state); |
269 | 275 |
270 #if defined(OS_CHROMEOS) | 276 #if defined(OS_CHROMEOS) |
271 if (!success) { | 277 if (!success) { |
272 PLOG(ERROR) << "Unable to initialize logging to " << log_path.value() | 278 PLOG(ERROR) << "Unable to initialize logging to " << log_path.value() |
273 << " (which should be a link to " << target_path.value() << ")"; | 279 << " (which should be a link to " << target_path.value() << ")"; |
274 RemoveSymlinkAndLog(log_path, target_path); | 280 RemoveSymlinkAndLog(log_path, target_path); |
275 return; | 281 return; |
276 } | 282 } |
277 #else | 283 #else |
278 if (!success) { | 284 if (!success) { |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 assertions->push_back(wide_line); | 390 assertions->push_back(wide_line); |
385 ++assertion_count; | 391 ++assertion_count; |
386 } | 392 } |
387 } | 393 } |
388 log_file.close(); | 394 log_file.close(); |
389 | 395 |
390 return assertion_count; | 396 return assertion_count; |
391 } | 397 } |
392 | 398 |
393 } // namespace logging | 399 } // namespace logging |
OLD | NEW |