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 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <io.h> | 8 #include <io.h> |
9 #include <windows.h> | 9 #include <windows.h> |
10 typedef HANDLE FileHandle; | 10 typedef HANDLE FileHandle; |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 | 548 |
549 LogMessage::LogMessage(const char* file, int line, LogSeverity severity, | 549 LogMessage::LogMessage(const char* file, int line, LogSeverity severity, |
550 std::string* result) | 550 std::string* result) |
551 : severity_(severity), file_(file), line_(line) { | 551 : severity_(severity), file_(file), line_(line) { |
552 Init(file, line); | 552 Init(file, line); |
553 stream_ << "Check failed: " << *result; | 553 stream_ << "Check failed: " << *result; |
554 delete result; | 554 delete result; |
555 } | 555 } |
556 | 556 |
557 LogMessage::~LogMessage() { | 557 LogMessage::~LogMessage() { |
558 #if !defined(NDEBUG) && !defined(OS_NACL) | 558 #if !defined(NDEBUG) && !defined(OS_NACL) && !defined(__UCLIBC__) |
559 if (severity_ == LOG_FATAL) { | 559 if (severity_ == LOG_FATAL) { |
560 // Include a stack trace on a fatal. | 560 // Include a stack trace on a fatal. |
561 base::debug::StackTrace trace; | 561 base::debug::StackTrace trace; |
562 stream_ << std::endl; // Newline to separate from log message. | 562 stream_ << std::endl; // Newline to separate from log message. |
563 trace.OutputToStream(&stream_); | 563 trace.OutputToStream(&stream_); |
564 } | 564 } |
565 #endif | 565 #endif |
566 stream_ << std::endl; | 566 stream_ << std::endl; |
567 std::string str_newline(stream_.str()); | 567 std::string str_newline(stream_.str()); |
568 | 568 |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
848 return *log_file_name; | 848 return *log_file_name; |
849 return std::wstring(); | 849 return std::wstring(); |
850 } | 850 } |
851 #endif | 851 #endif |
852 | 852 |
853 } // namespace logging | 853 } // namespace logging |
854 | 854 |
855 std::ostream& operator<<(std::ostream& out, const wchar_t* wstr) { | 855 std::ostream& operator<<(std::ostream& out, const wchar_t* wstr) { |
856 return out << base::WideToUTF8(std::wstring(wstr)); | 856 return out << base::WideToUTF8(std::wstring(wstr)); |
857 } | 857 } |
OLD | NEW |