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 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 | 514 |
515 #if defined(OS_WIN) | 515 #if defined(OS_WIN) |
516 LogMessage::SaveLastError::SaveLastError() : last_error_(::GetLastError()) { | 516 LogMessage::SaveLastError::SaveLastError() : last_error_(::GetLastError()) { |
517 } | 517 } |
518 | 518 |
519 LogMessage::SaveLastError::~SaveLastError() { | 519 LogMessage::SaveLastError::~SaveLastError() { |
520 ::SetLastError(last_error_); | 520 ::SetLastError(last_error_); |
521 } | 521 } |
522 #endif // defined(OS_WIN) | 522 #endif // defined(OS_WIN) |
523 | 523 |
524 LogMessage::LogMessage(const char* file, int line, LogSeverity severity, | |
525 int ctr) | |
526 : severity_(severity), file_(file), line_(line) { | |
527 Init(file, line); | |
528 } | |
529 | |
530 LogMessage::LogMessage(const char* file, int line) | |
531 : severity_(LOG_INFO), file_(file), line_(line) { | |
532 Init(file, line); | |
533 } | |
534 | |
535 LogMessage::LogMessage(const char* file, int line, LogSeverity severity) | 524 LogMessage::LogMessage(const char* file, int line, LogSeverity severity) |
536 : severity_(severity), file_(file), line_(line) { | 525 : severity_(severity), file_(file), line_(line) { |
537 Init(file, line); | 526 Init(file, line); |
538 } | 527 } |
539 | 528 |
540 LogMessage::LogMessage(const char* file, int line, std::string* result) | 529 LogMessage::LogMessage(const char* file, int line, std::string* result) |
541 : severity_(LOG_FATAL), file_(file), line_(line) { | 530 : severity_(LOG_FATAL), file_(file), line_(line) { |
542 Init(file, line); | 531 Init(file, line); |
543 stream_ << "Check failed: " << *result; | 532 stream_ << "Check failed: " << *result; |
544 delete result; | 533 delete result; |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
817 return *log_file_name; | 806 return *log_file_name; |
818 return std::wstring(); | 807 return std::wstring(); |
819 } | 808 } |
820 #endif | 809 #endif |
821 | 810 |
822 } // namespace logging | 811 } // namespace logging |
823 | 812 |
824 std::ostream& operator<<(std::ostream& out, const wchar_t* wstr) { | 813 std::ostream& operator<<(std::ostream& out, const wchar_t* wstr) { |
825 return out << base::WideToUTF8(std::wstring(wstr)); | 814 return out << base::WideToUTF8(std::wstring(wstr)); |
826 } | 815 } |
OLD | NEW |