OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <windows.h> | 8 #include <windows.h> |
9 typedef HANDLE FileHandle; | 9 typedef HANDLE FileHandle; |
10 typedef HANDLE MutexHandle; | 10 typedef HANDLE MutexHandle; |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 t.append(safe_name); | 221 t.append(safe_name); |
222 log_mutex = ::CreateMutex(NULL, FALSE, t.c_str()); | 222 log_mutex = ::CreateMutex(NULL, FALSE, t.c_str()); |
223 } | 223 } |
224 #elif defined(OS_POSIX) | 224 #elif defined(OS_POSIX) |
225 // statically initialized | 225 // statically initialized |
226 #endif | 226 #endif |
227 } | 227 } |
228 | 228 |
229 void InitLogging(const PathChar* new_log_file, LoggingDestination logging_dest, | 229 void InitLogging(const PathChar* new_log_file, LoggingDestination logging_dest, |
230 LogLockingState lock_log, OldFileDeletionState delete_old) { | 230 LogLockingState lock_log, OldFileDeletionState delete_old) { |
231 g_enable_dcheck = CommandLine().HasSwitch(switches::kEnableDCHECK); | 231 g_enable_dcheck = |
| 232 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableDCHECK); |
232 | 233 |
233 if (log_file) { | 234 if (log_file) { |
234 // calling InitLogging twice or after some log call has already opened the | 235 // calling InitLogging twice or after some log call has already opened the |
235 // default log file will re-initialize to the new options | 236 // default log file will re-initialize to the new options |
236 CloseFile(log_file); | 237 CloseFile(log_file); |
237 log_file = NULL; | 238 log_file = NULL; |
238 } | 239 } |
239 | 240 |
240 lock_log_file = lock_log; | 241 lock_log_file = lock_log; |
241 logging_destination = logging_dest; | 242 logging_destination = logging_dest; |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 | 520 |
520 CloseFile(log_file); | 521 CloseFile(log_file); |
521 log_file = NULL; | 522 log_file = NULL; |
522 } | 523 } |
523 | 524 |
524 } // namespace logging | 525 } // namespace logging |
525 | 526 |
526 std::ostream& operator<<(std::ostream& out, const wchar_t* wstr) { | 527 std::ostream& operator<<(std::ostream& out, const wchar_t* wstr) { |
527 return out << base::SysWideToUTF8(std::wstring(wstr)); | 528 return out << base::SysWideToUTF8(std::wstring(wstr)); |
528 } | 529 } |
OLD | NEW |