| 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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 : logging_dest(LOG_DEFAULT), | 352 : logging_dest(LOG_DEFAULT), |
| 353 log_file(NULL), | 353 log_file(NULL), |
| 354 lock_log(LOCK_LOG_FILE), | 354 lock_log(LOCK_LOG_FILE), |
| 355 delete_old(APPEND_TO_OLD_LOG_FILE) {} | 355 delete_old(APPEND_TO_OLD_LOG_FILE) {} |
| 356 | 356 |
| 357 bool BaseInitLoggingImpl(const LoggingSettings& settings) { | 357 bool BaseInitLoggingImpl(const LoggingSettings& settings) { |
| 358 #if defined(OS_NACL) | 358 #if defined(OS_NACL) |
| 359 // Can log only to the system debug log. | 359 // Can log only to the system debug log. |
| 360 CHECK_EQ(settings.logging_dest & ~LOG_TO_SYSTEM_DEBUG_LOG, 0); | 360 CHECK_EQ(settings.logging_dest & ~LOG_TO_SYSTEM_DEBUG_LOG, 0); |
| 361 #endif | 361 #endif |
| 362 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 362 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 363 // Don't bother initializing g_vlog_info unless we use one of the | 363 // Don't bother initializing g_vlog_info unless we use one of the |
| 364 // vlog switches. | 364 // vlog switches. |
| 365 if (command_line->HasSwitch(switches::kV) || | 365 if (command_line->HasSwitch(switches::kV) || |
| 366 command_line->HasSwitch(switches::kVModule)) { | 366 command_line->HasSwitch(switches::kVModule)) { |
| 367 // NOTE: If g_vlog_info has already been initialized, it might be in use | 367 // NOTE: If g_vlog_info has already been initialized, it might be in use |
| 368 // by another thread. Don't delete the old VLogInfo, just create a second | 368 // by another thread. Don't delete the old VLogInfo, just create a second |
| 369 // one. We keep track of both to avoid memory leak warnings. | 369 // one. We keep track of both to avoid memory leak warnings. |
| 370 CHECK(!g_vlog_info_prev); | 370 CHECK(!g_vlog_info_prev); |
| 371 g_vlog_info_prev = g_vlog_info; | 371 g_vlog_info_prev = g_vlog_info; |
| 372 | 372 |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 803 return *log_file_name; | 803 return *log_file_name; |
| 804 return std::wstring(); | 804 return std::wstring(); |
| 805 } | 805 } |
| 806 #endif | 806 #endif |
| 807 | 807 |
| 808 } // namespace logging | 808 } // namespace logging |
| 809 | 809 |
| 810 std::ostream& std::operator<<(std::ostream& out, const wchar_t* wstr) { | 810 std::ostream& std::operator<<(std::ostream& out, const wchar_t* wstr) { |
| 811 return out << base::WideToUTF8(std::wstring(wstr)); | 811 return out << base::WideToUTF8(std::wstring(wstr)); |
| 812 } | 812 } |
| OLD | NEW |