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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 CHECK_EQ(settings.logging_dest & ~LOG_TO_SYSTEM_DEBUG_LOG, 0); | 363 CHECK_EQ(settings.logging_dest & ~LOG_TO_SYSTEM_DEBUG_LOG, 0); |
364 #endif | 364 #endif |
365 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 365 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
366 // Don't bother initializing g_vlog_info unless we use one of the | 366 // Don't bother initializing g_vlog_info unless we use one of the |
367 // vlog switches. | 367 // vlog switches. |
368 if (command_line->HasSwitch(switches::kV) || | 368 if (command_line->HasSwitch(switches::kV) || |
369 command_line->HasSwitch(switches::kVModule)) { | 369 command_line->HasSwitch(switches::kVModule)) { |
370 // NOTE: If g_vlog_info has already been initialized, it might be in use | 370 // NOTE: If g_vlog_info has already been initialized, it might be in use |
371 // by another thread. Don't delete the old VLogInfo, just create a second | 371 // by another thread. Don't delete the old VLogInfo, just create a second |
372 // one. We keep track of both to avoid memory leak warnings. | 372 // one. We keep track of both to avoid memory leak warnings. |
373 CHECK(!g_vlog_info_prev); | 373 // CHECK(!g_vlog_info_prev); |
374 g_vlog_info_prev = g_vlog_info; | 374 g_vlog_info_prev = g_vlog_info; |
375 | 375 |
376 g_vlog_info = | 376 g_vlog_info = |
377 new VlogInfo(command_line->GetSwitchValueASCII(switches::kV), | 377 new VlogInfo(command_line->GetSwitchValueASCII(switches::kV), |
378 command_line->GetSwitchValueASCII(switches::kVModule), | 378 command_line->GetSwitchValueASCII(switches::kVModule), |
379 &min_log_level); | 379 &min_log_level); |
380 } | 380 } |
381 | 381 |
382 logging_destination = settings.logging_dest; | 382 logging_destination = settings.logging_dest; |
383 | 383 |
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
830 return *log_file_name; | 830 return *log_file_name; |
831 return std::wstring(); | 831 return std::wstring(); |
832 } | 832 } |
833 #endif | 833 #endif |
834 | 834 |
835 } // namespace logging | 835 } // namespace logging |
836 | 836 |
837 std::ostream& operator<<(std::ostream& out, const wchar_t* wstr) { | 837 std::ostream& operator<<(std::ostream& out, const wchar_t* wstr) { |
838 return out << base::WideToUTF8(std::wstring(wstr)); | 838 return out << base::WideToUTF8(std::wstring(wstr)); |
839 } | 839 } |
OLD | NEW |