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