Chromium Code Reviews| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 54 #include "content/public/common/content_switches.h" | 54 #include "content/public/common/content_switches.h" |
| 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" | |
| 65 #include "chrome/install_static/install_modes.h" | |
| 64 #endif | 66 #endif |
| 65 | 67 |
| 66 namespace { | 68 namespace { |
| 67 | 69 |
| 68 // When true, this means that error dialogs should not be shown. | 70 // When true, this means that error dialogs should not be shown. |
| 69 bool dialogs_are_suppressed_ = false; | 71 bool dialogs_are_suppressed_ = false; |
| 70 | 72 |
| 71 // This should be true for exactly the period between the end of | 73 // This should be true for exactly the period between the end of |
| 72 // InitChromeLogging() and the beginning of CleanupChromeLogging(). | 74 // InitChromeLogging() and the beginning of CleanupChromeLogging(). |
| 73 bool chrome_logging_initialized_ = false; | 75 bool chrome_logging_initialized_ = false; |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 352 level < LOG_NUM_SEVERITIES) { | 354 level < LOG_NUM_SEVERITIES) { |
| 353 logging::SetMinLogLevel(level); | 355 logging::SetMinLogLevel(level); |
| 354 } else { | 356 } else { |
| 355 DLOG(WARNING) << "Bad log level: " << log_level; | 357 DLOG(WARNING) << "Bad log level: " << log_level; |
| 356 } | 358 } |
| 357 } | 359 } |
| 358 | 360 |
| 359 #if defined(OS_WIN) | 361 #if defined(OS_WIN) |
| 360 // Enable trace control and transport through event tracing for Windows. | 362 // Enable trace control and transport through event tracing for Windows. |
| 361 logging::LogEventProvider::Initialize(kChromeTraceProviderName); | 363 logging::LogEventProvider::Initialize(kChromeTraceProviderName); |
| 364 | |
| 365 // Enable logging to the Windows Event Log. | |
| 366 logging::SetEventSourceName( | |
| 367 base::UTF16ToASCII(install_static::kProductPathName)); | |
|
grt (UTC plus 2)
2016/11/25 15:25:35
while this will be a brand-specific string (e.g.,
pastarmovj
2016/11/28 12:23:03
I am not convinced that this particular use case d
| |
| 362 #endif | 368 #endif |
| 363 | 369 |
| 364 base::StatisticsRecorder::InitLogOnShutdown(); | 370 base::StatisticsRecorder::InitLogOnShutdown(); |
| 365 | 371 |
| 366 chrome_logging_initialized_ = true; | 372 chrome_logging_initialized_ = true; |
| 367 } | 373 } |
| 368 | 374 |
| 369 // This is a no-op, but we'll keep it around in case | 375 // This is a no-op, but we'll keep it around in case |
| 370 // we need to do more cleanup in the future. | 376 // we need to do more cleanup in the future. |
| 371 void CleanupChromeLogging() { | 377 void CleanupChromeLogging() { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 410 time_deets.year, | 416 time_deets.year, |
| 411 time_deets.month, | 417 time_deets.month, |
| 412 time_deets.day_of_month, | 418 time_deets.day_of_month, |
| 413 time_deets.hour, | 419 time_deets.hour, |
| 414 time_deets.minute, | 420 time_deets.minute, |
| 415 time_deets.second); | 421 time_deets.second); |
| 416 return base_path.InsertBeforeExtensionASCII(suffix); | 422 return base_path.InsertBeforeExtensionASCII(suffix); |
| 417 } | 423 } |
| 418 | 424 |
| 419 } // namespace logging | 425 } // namespace logging |
| OLD | NEW |