Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Side by Side Diff: base/logging.cc

Issue 1641513004: Update //base to chromium 9659b08ea5a34f889dc4166217f438095ddc10d2 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/logging.h ('k') | base/mac/OWNERS » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
514 LogMessage::SaveLastError::~SaveLastError() { 514 LogMessage::SaveLastError::~SaveLastError() {
515 ::SetLastError(last_error_); 515 ::SetLastError(last_error_);
516 } 516 }
517 #endif // defined(OS_WIN) 517 #endif // defined(OS_WIN)
518 518
519 LogMessage::LogMessage(const char* file, int line, LogSeverity severity) 519 LogMessage::LogMessage(const char* file, int line, LogSeverity severity)
520 : severity_(severity), file_(file), line_(line) { 520 : severity_(severity), file_(file), line_(line) {
521 Init(file, line); 521 Init(file, line);
522 } 522 }
523 523
524 LogMessage::LogMessage(const char* file, int line, const char* condition)
525 : severity_(LOG_FATAL), file_(file), line_(line) {
526 Init(file, line);
527 stream_ << "Check failed: " << condition << ". ";
528 }
529
524 LogMessage::LogMessage(const char* file, int line, std::string* result) 530 LogMessage::LogMessage(const char* file, int line, std::string* result)
525 : severity_(LOG_FATAL), file_(file), line_(line) { 531 : severity_(LOG_FATAL), file_(file), line_(line) {
526 Init(file, line); 532 Init(file, line);
527 stream_ << "Check failed: " << *result; 533 stream_ << "Check failed: " << *result;
528 delete result; 534 delete result;
529 } 535 }
530 536
531 LogMessage::LogMessage(const char* file, int line, LogSeverity severity, 537 LogMessage::LogMessage(const char* file, int line, LogSeverity severity,
532 std::string* result) 538 std::string* result)
533 : severity_(severity), file_(file), line_(line) { 539 : severity_(severity), file_(file), line_(line) {
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 BASE_EXPORT void LogErrorNotReached(const char* file, int line) { 812 BASE_EXPORT void LogErrorNotReached(const char* file, int line) {
807 LogMessage(file, line, LOG_ERROR).stream() 813 LogMessage(file, line, LOG_ERROR).stream()
808 << "NOTREACHED() hit."; 814 << "NOTREACHED() hit.";
809 } 815 }
810 816
811 } // namespace logging 817 } // namespace logging
812 818
813 std::ostream& std::operator<<(std::ostream& out, const wchar_t* wstr) { 819 std::ostream& std::operator<<(std::ostream& out, const wchar_t* wstr) {
814 return out << base::WideToUTF8(wstr); 820 return out << base::WideToUTF8(wstr);
815 } 821 }
OLDNEW
« no previous file with comments | « base/logging.h ('k') | base/mac/OWNERS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698