OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include <limits.h> | 7 #include <limits.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 527 matching lines...) Loading... |
538 LogMessage::LogMessage(const char* file, int line, LogSeverity severity, | 538 LogMessage::LogMessage(const char* file, int line, LogSeverity severity, |
539 std::string* result) | 539 std::string* result) |
540 : severity_(severity), file_(file), line_(line) { | 540 : severity_(severity), file_(file), line_(line) { |
541 Init(file, line); | 541 Init(file, line); |
542 stream_ << "Check failed: " << *result; | 542 stream_ << "Check failed: " << *result; |
543 delete result; | 543 delete result; |
544 } | 544 } |
545 | 545 |
546 LogMessage::~LogMessage() { | 546 LogMessage::~LogMessage() { |
547 size_t stack_start = stream_.tellp(); | 547 size_t stack_start = stream_.tellp(); |
548 #if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && !defined(__UCLIBC__) | 548 #if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && !defined(__UCLIBC__) && \ |
| 549 !defined(OS_AIX) |
549 if (severity_ == LOG_FATAL && !base::debug::BeingDebugged()) { | 550 if (severity_ == LOG_FATAL && !base::debug::BeingDebugged()) { |
550 // Include a stack trace on a fatal, unless a debugger is attached. | 551 // Include a stack trace on a fatal, unless a debugger is attached. |
551 base::debug::StackTrace trace; | 552 base::debug::StackTrace trace; |
552 stream_ << std::endl; // Newline to separate from log message. | 553 stream_ << std::endl; // Newline to separate from log message. |
553 trace.OutputToStream(&stream_); | 554 trace.OutputToStream(&stream_); |
554 } | 555 } |
555 #endif | 556 #endif |
556 stream_ << std::endl; | 557 stream_ << std::endl; |
557 std::string str_newline(stream_.str()); | 558 std::string str_newline(stream_.str()); |
558 | 559 |
(...skipping 411 matching lines...) Loading... |
970 BASE_EXPORT void LogErrorNotReached(const char* file, int line) { | 971 BASE_EXPORT void LogErrorNotReached(const char* file, int line) { |
971 LogMessage(file, line, LOG_ERROR).stream() | 972 LogMessage(file, line, LOG_ERROR).stream() |
972 << "NOTREACHED() hit."; | 973 << "NOTREACHED() hit."; |
973 } | 974 } |
974 | 975 |
975 } // namespace logging | 976 } // namespace logging |
976 | 977 |
977 std::ostream& std::operator<<(std::ostream& out, const wchar_t* wstr) { | 978 std::ostream& std::operator<<(std::ostream& out, const wchar_t* wstr) { |
978 return out << (wstr ? base::WideToUTF8(wstr) : std::string()); | 979 return out << (wstr ? base::WideToUTF8(wstr) : std::string()); |
979 } | 980 } |
OLD | NEW |