| 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 // Need to include this before most other files because it defines | 7 // Need to include this before most other files because it defines |
| 8 // IPC_MESSAGE_LOG_ENABLED. We need to use it to define | 8 // IPC_MESSAGE_LOG_ENABLED. We need to use it to define |
| 9 // IPC_MESSAGE_MACROS_LOG_ENABLED so render_messages.h will generate the | 9 // IPC_MESSAGE_MACROS_LOG_ENABLED so render_messages.h will generate the |
| 10 // ViewMsgLog et al. functions. | 10 // ViewMsgLog et al. functions. |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 #include "ipc/ipc_logging.h" | 55 #include "ipc/ipc_logging.h" |
| 56 | 56 |
| 57 #if defined(OS_CHROMEOS) | 57 #if defined(OS_CHROMEOS) |
| 58 #include "chromeos/chromeos_switches.h" | 58 #include "chromeos/chromeos_switches.h" |
| 59 #endif | 59 #endif |
| 60 | 60 |
| 61 #if defined(OS_WIN) | 61 #if defined(OS_WIN) |
| 62 #include <initguid.h> | 62 #include <initguid.h> |
| 63 #include "base/logging_win.h" | 63 #include "base/logging_win.h" |
| 64 #include "base/syslog_logging.h" | 64 #include "base/syslog_logging.h" |
| 65 #include "chrome/common/win/eventlog_messages.h" |
| 65 #include "chrome/install_static/install_details.h" | 66 #include "chrome/install_static/install_details.h" |
| 66 #endif | 67 #endif |
| 67 | 68 |
| 68 namespace logging { | 69 namespace logging { |
| 69 namespace { | 70 namespace { |
| 70 | 71 |
| 71 // When true, this means that error dialogs should not be shown. | 72 // When true, this means that error dialogs should not be shown. |
| 72 bool dialogs_are_suppressed_ = false; | 73 bool dialogs_are_suppressed_ = false; |
| 73 ScopedLogAssertHandler* assert_handler_ = nullptr; | 74 ScopedLogAssertHandler* assert_handler_ = nullptr; |
| 74 | 75 |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 } else { | 326 } else { |
| 326 DLOG(WARNING) << "Bad log level: " << log_level; | 327 DLOG(WARNING) << "Bad log level: " << log_level; |
| 327 } | 328 } |
| 328 } | 329 } |
| 329 | 330 |
| 330 #if defined(OS_WIN) | 331 #if defined(OS_WIN) |
| 331 // Enable trace control and transport through event tracing for Windows. | 332 // Enable trace control and transport through event tracing for Windows. |
| 332 LogEventProvider::Initialize(kChromeTraceProviderName); | 333 LogEventProvider::Initialize(kChromeTraceProviderName); |
| 333 | 334 |
| 334 // Enable logging to the Windows Event Log. | 335 // Enable logging to the Windows Event Log. |
| 335 SetEventSourceName(base::UTF16ToASCII( | 336 SetEventSource(base::UTF16ToASCII( |
| 336 install_static::InstallDetails::Get().install_full_name())); | 337 install_static::InstallDetails::Get().install_full_name()), |
| 338 BROWSER_CATEGORY, MSG_LOG_MESSAGE); |
| 337 #endif | 339 #endif |
| 338 | 340 |
| 339 base::StatisticsRecorder::InitLogOnShutdown(); | 341 base::StatisticsRecorder::InitLogOnShutdown(); |
| 340 | 342 |
| 341 chrome_logging_initialized_ = true; | 343 chrome_logging_initialized_ = true; |
| 342 } | 344 } |
| 343 | 345 |
| 344 // This is a no-op, but we'll keep it around in case | 346 // This is a no-op, but we'll keep it around in case |
| 345 // we need to do more cleanup in the future. | 347 // we need to do more cleanup in the future. |
| 346 void CleanupChromeLogging() { | 348 void CleanupChromeLogging() { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 time_deets.year, | 387 time_deets.year, |
| 386 time_deets.month, | 388 time_deets.month, |
| 387 time_deets.day_of_month, | 389 time_deets.day_of_month, |
| 388 time_deets.hour, | 390 time_deets.hour, |
| 389 time_deets.minute, | 391 time_deets.minute, |
| 390 time_deets.second); | 392 time_deets.second); |
| 391 return base_path.InsertBeforeExtensionASCII(suffix); | 393 return base_path.InsertBeforeExtensionASCII(suffix); |
| 392 } | 394 } |
| 393 | 395 |
| 394 } // namespace logging | 396 } // namespace logging |
| OLD | NEW |