| 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 21 matching lines...) Expand all Loading... |
| 32 #include <string> // NOLINT | 32 #include <string> // NOLINT |
| 33 | 33 |
| 34 #include "base/base_switches.h" | 34 #include "base/base_switches.h" |
| 35 #include "base/command_line.h" | 35 #include "base/command_line.h" |
| 36 #include "base/compiler_specific.h" | 36 #include "base/compiler_specific.h" |
| 37 #include "base/debug/debugger.h" | 37 #include "base/debug/debugger.h" |
| 38 #include "base/debug/dump_without_crashing.h" | 38 #include "base/debug/dump_without_crashing.h" |
| 39 #include "base/environment.h" | 39 #include "base/environment.h" |
| 40 #include "base/files/file_path.h" | 40 #include "base/files/file_path.h" |
| 41 #include "base/files/file_util.h" | 41 #include "base/files/file_util.h" |
| 42 #include "base/metrics/statistics_recorder.h" |
| 42 #include "base/path_service.h" | 43 #include "base/path_service.h" |
| 43 #include "base/strings/string_number_conversions.h" | 44 #include "base/strings/string_number_conversions.h" |
| 44 #include "base/strings/string_util.h" | 45 #include "base/strings/string_util.h" |
| 45 #include "base/strings/stringprintf.h" | 46 #include "base/strings/stringprintf.h" |
| 46 #include "base/strings/utf_string_conversions.h" | 47 #include "base/strings/utf_string_conversions.h" |
| 47 #include "base/threading/thread_restrictions.h" | 48 #include "base/threading/thread_restrictions.h" |
| 48 #include "chrome/common/chrome_constants.h" | 49 #include "chrome/common/chrome_constants.h" |
| 49 #include "chrome/common/chrome_paths.h" | 50 #include "chrome/common/chrome_paths.h" |
| 50 #include "chrome/common/chrome_switches.h" | 51 #include "chrome/common/chrome_switches.h" |
| 51 #include "chrome/common/env_vars.h" | 52 #include "chrome/common/env_vars.h" |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 } else { | 353 } else { |
| 353 DLOG(WARNING) << "Bad log level: " << log_level; | 354 DLOG(WARNING) << "Bad log level: " << log_level; |
| 354 } | 355 } |
| 355 } | 356 } |
| 356 | 357 |
| 357 #if defined(OS_WIN) | 358 #if defined(OS_WIN) |
| 358 // Enable trace control and transport through event tracing for Windows. | 359 // Enable trace control and transport through event tracing for Windows. |
| 359 logging::LogEventProvider::Initialize(kChromeTraceProviderName); | 360 logging::LogEventProvider::Initialize(kChromeTraceProviderName); |
| 360 #endif | 361 #endif |
| 361 | 362 |
| 363 base::StatisticsRecorder::InitLogOnShutdown(); |
| 364 |
| 362 chrome_logging_initialized_ = true; | 365 chrome_logging_initialized_ = true; |
| 363 } | 366 } |
| 364 | 367 |
| 365 // This is a no-op, but we'll keep it around in case | 368 // This is a no-op, but we'll keep it around in case |
| 366 // we need to do more cleanup in the future. | 369 // we need to do more cleanup in the future. |
| 367 void CleanupChromeLogging() { | 370 void CleanupChromeLogging() { |
| 368 if (chrome_logging_failed_) | 371 if (chrome_logging_failed_) |
| 369 return; // We failed to initiailize logging, no cleanup. | 372 return; // We failed to initiailize logging, no cleanup. |
| 370 | 373 |
| 371 DCHECK(chrome_logging_initialized_) << | 374 DCHECK(chrome_logging_initialized_) << |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 time_deets.year, | 409 time_deets.year, |
| 407 time_deets.month, | 410 time_deets.month, |
| 408 time_deets.day_of_month, | 411 time_deets.day_of_month, |
| 409 time_deets.hour, | 412 time_deets.hour, |
| 410 time_deets.minute, | 413 time_deets.minute, |
| 411 time_deets.second); | 414 time_deets.second); |
| 412 return base_path.InsertBeforeExtensionASCII(suffix); | 415 return base_path.InsertBeforeExtensionASCII(suffix); |
| 413 } | 416 } |
| 414 | 417 |
| 415 } // namespace logging | 418 } // namespace logging |
| OLD | NEW |