OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 if (!log_file_name) | 375 if (!log_file_name) |
376 log_file_name = new PathString(); | 376 log_file_name = new PathString(); |
377 *log_file_name = new_log_file; | 377 *log_file_name = new_log_file; |
378 if (delete_old == DELETE_OLD_LOG_FILE) | 378 if (delete_old == DELETE_OLD_LOG_FILE) |
379 DeleteFilePath(*log_file_name); | 379 DeleteFilePath(*log_file_name); |
380 | 380 |
381 return InitializeLogFileHandle(); | 381 return InitializeLogFileHandle(); |
382 } | 382 } |
383 | 383 |
384 void SetMinLogLevel(int level) { | 384 void SetMinLogLevel(int level) { |
385 min_log_level = level; | 385 min_log_level = std::min(LOG_ERROR_REPORT, level); |
386 } | 386 } |
387 | 387 |
388 int GetMinLogLevel() { | 388 int GetMinLogLevel() { |
389 return min_log_level; | 389 return min_log_level; |
390 } | 390 } |
391 | 391 |
392 int GetVlogLevelHelper(const char* file, size_t N) { | 392 int GetVlogLevelHelper(const char* file, size_t N) { |
393 DCHECK_GT(N, 0U); | 393 DCHECK_GT(N, 0U); |
394 return g_vlog_info ? | 394 return g_vlog_info ? |
395 g_vlog_info->GetVlogLevel(base::StringPiece(file, N - 1)) : | 395 g_vlog_info->GetVlogLevel(base::StringPiece(file, N - 1)) : |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
794 | 794 |
795 if (level == LOG_FATAL) | 795 if (level == LOG_FATAL) |
796 base::debug::BreakDebugger(); | 796 base::debug::BreakDebugger(); |
797 } | 797 } |
798 | 798 |
799 } // namespace logging | 799 } // namespace logging |
800 | 800 |
801 std::ostream& operator<<(std::ostream& out, const wchar_t* wstr) { | 801 std::ostream& operator<<(std::ostream& out, const wchar_t* wstr) { |
802 return out << WideToUTF8(std::wstring(wstr)); | 802 return out << WideToUTF8(std::wstring(wstr)); |
803 } | 803 } |
OLD | NEW |