| 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 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 case LOG_WARNING: | 575 case LOG_WARNING: |
| 576 priority = ANDROID_LOG_WARN; | 576 priority = ANDROID_LOG_WARN; |
| 577 break; | 577 break; |
| 578 case LOG_ERROR: | 578 case LOG_ERROR: |
| 579 priority = ANDROID_LOG_ERROR; | 579 priority = ANDROID_LOG_ERROR; |
| 580 break; | 580 break; |
| 581 case LOG_FATAL: | 581 case LOG_FATAL: |
| 582 priority = ANDROID_LOG_FATAL; | 582 priority = ANDROID_LOG_FATAL; |
| 583 break; | 583 break; |
| 584 } | 584 } |
| 585 __android_log_write(priority, "chromium", str_newline.c_str()); | 585 __android_log_write(priority, ANDROID_LOG_TAG, str_newline.c_str()); |
| 586 #endif | 586 #endif |
| 587 ignore_result(fwrite(str_newline.data(), str_newline.size(), 1, stderr)); | 587 ignore_result(fwrite(str_newline.data(), str_newline.size(), 1, stderr)); |
| 588 fflush(stderr); | 588 fflush(stderr); |
| 589 } else if (severity_ >= kAlwaysPrintErrorLevel) { | 589 } else if (severity_ >= kAlwaysPrintErrorLevel) { |
| 590 // When we're only outputting to a log file, above a certain log level, we | 590 // When we're only outputting to a log file, above a certain log level, we |
| 591 // should still output to stderr so that we can better detect and diagnose | 591 // should still output to stderr so that we can better detect and diagnose |
| 592 // problems with unit tests, especially on the buildbots. | 592 // problems with unit tests, especially on the buildbots. |
| 593 ignore_result(fwrite(str_newline.data(), str_newline.size(), 1, stderr)); | 593 ignore_result(fwrite(str_newline.data(), str_newline.size(), 1, stderr)); |
| 594 fflush(stderr); | 594 fflush(stderr); |
| 595 } | 595 } |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 812 BASE_EXPORT void LogErrorNotReached(const char* file, int line) { | 812 BASE_EXPORT void LogErrorNotReached(const char* file, int line) { |
| 813 LogMessage(file, line, LOG_ERROR).stream() | 813 LogMessage(file, line, LOG_ERROR).stream() |
| 814 << "NOTREACHED() hit."; | 814 << "NOTREACHED() hit."; |
| 815 } | 815 } |
| 816 | 816 |
| 817 } // namespace logging | 817 } // namespace logging |
| 818 | 818 |
| 819 std::ostream& std::operator<<(std::ostream& out, const wchar_t* wstr) { | 819 std::ostream& std::operator<<(std::ostream& out, const wchar_t* wstr) { |
| 820 return out << base::WideToUTF8(wstr); | 820 return out << base::WideToUTF8(wstr); |
| 821 } | 821 } |
| OLD | NEW |