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 "base/logging.h" | 5 #include "base/logging.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 typedef HANDLE FileHandle; | 9 typedef HANDLE FileHandle; |
10 typedef HANDLE MutexHandle; | 10 typedef HANDLE MutexHandle; |
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 // Don't use the string with the newline, get a fresh version to send to | 518 // Don't use the string with the newline, get a fresh version to send to |
519 // the debug message process. We also don't display assertions to the | 519 // the debug message process. We also don't display assertions to the |
520 // user in release mode. The enduser can't do anything with this | 520 // user in release mode. The enduser can't do anything with this |
521 // information, and displaying message boxes when the application is | 521 // information, and displaying message boxes when the application is |
522 // hosed can cause additional problems. | 522 // hosed can cause additional problems. |
523 #ifndef NDEBUG | 523 #ifndef NDEBUG |
524 DisplayDebugMessage(stream_.str()); | 524 DisplayDebugMessage(stream_.str()); |
525 #endif | 525 #endif |
526 // Crash the process to generate a dump. | 526 // Crash the process to generate a dump. |
527 DebugUtil::BreakDebugger(); | 527 DebugUtil::BreakDebugger(); |
528 // TODO(mmentovai): when we have breakpad support, generate a breakpad | |
529 // dump, but until then, do not invoke the Apple crash reporter. | |
530 } | 528 } |
531 } | 529 } |
532 } else if (severity_ == LOG_ERROR_REPORT) { | 530 } else if (severity_ == LOG_ERROR_REPORT) { |
533 // We are here only if the user runs with --enable-dcheck in release mode. | 531 // We are here only if the user runs with --enable-dcheck in release mode. |
534 if (log_report_handler) { | 532 if (log_report_handler) { |
535 log_report_handler(std::string(stream_.str())); | 533 log_report_handler(std::string(stream_.str())); |
536 } else { | 534 } else { |
537 DisplayDebugMessage(stream_.str()); | 535 DisplayDebugMessage(stream_.str()); |
538 } | 536 } |
539 } | 537 } |
540 } | 538 } |
541 | 539 |
542 void CloseLogFile() { | 540 void CloseLogFile() { |
543 if (!log_file) | 541 if (!log_file) |
544 return; | 542 return; |
545 | 543 |
546 CloseFile(log_file); | 544 CloseFile(log_file); |
547 log_file = NULL; | 545 log_file = NULL; |
548 } | 546 } |
549 | 547 |
550 } // namespace logging | 548 } // namespace logging |
551 | 549 |
552 std::ostream& operator<<(std::ostream& out, const wchar_t* wstr) { | 550 std::ostream& operator<<(std::ostream& out, const wchar_t* wstr) { |
553 return out << base::SysWideToUTF8(std::wstring(wstr)); | 551 return out << base::SysWideToUTF8(std::wstring(wstr)); |
554 } | 552 } |
OLD | NEW |