| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 20 matching lines...) Expand all Loading... |
| 31 #include "chrome/common/logging_chrome.h" | 31 #include "chrome/common/logging_chrome.h" |
| 32 | 32 |
| 33 #include "base/command_line.h" | 33 #include "base/command_line.h" |
| 34 #include "base/compiler_specific.h" | 34 #include "base/compiler_specific.h" |
| 35 #include "base/debug_util.h" | 35 #include "base/debug_util.h" |
| 36 #include "base/env_var.h" | 36 #include "base/env_var.h" |
| 37 #include "base/file_path.h" | 37 #include "base/file_path.h" |
| 38 #include "base/file_util.h" | 38 #include "base/file_util.h" |
| 39 #include "base/logging.h" | 39 #include "base/logging.h" |
| 40 #include "base/path_service.h" | 40 #include "base/path_service.h" |
| 41 #include "base/string_number_conversions.h" |
| 41 #include "base/string_util.h" | 42 #include "base/string_util.h" |
| 42 #include "base/time.h" | 43 #include "base/time.h" |
| 43 #include "base/utf_string_conversions.h" | 44 #include "base/utf_string_conversions.h" |
| 44 #include "chrome/common/chrome_paths.h" | 45 #include "chrome/common/chrome_paths.h" |
| 45 #include "chrome/common/chrome_switches.h" | 46 #include "chrome/common/chrome_switches.h" |
| 46 #include "chrome/common/env_vars.h" | 47 #include "chrome/common/env_vars.h" |
| 47 #include "ipc/ipc_logging.h" | 48 #include "ipc/ipc_logging.h" |
| 48 #if defined(OS_WIN) | 49 #if defined(OS_WIN) |
| 49 #include "base/logging_win.h" | 50 #include "base/logging_win.h" |
| 50 #include <initguid.h> | 51 #include <initguid.h> |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 | 204 |
| 204 std::string log_filter_prefix = | 205 std::string log_filter_prefix = |
| 205 command_line.GetSwitchValueASCII(switches::kLogFilterPrefix); | 206 command_line.GetSwitchValueASCII(switches::kLogFilterPrefix); |
| 206 logging::SetLogFilterPrefix(log_filter_prefix.c_str()); | 207 logging::SetLogFilterPrefix(log_filter_prefix.c_str()); |
| 207 | 208 |
| 208 // Use a minimum log level if the command line has one, otherwise set the | 209 // Use a minimum log level if the command line has one, otherwise set the |
| 209 // default to LOG_WARNING. | 210 // default to LOG_WARNING. |
| 210 std::string log_level = command_line.GetSwitchValueASCII( | 211 std::string log_level = command_line.GetSwitchValueASCII( |
| 211 switches::kLoggingLevel); | 212 switches::kLoggingLevel); |
| 212 int level = 0; | 213 int level = 0; |
| 213 if (StringToInt(log_level, &level)) { | 214 if (base::StringToInt(log_level, &level)) { |
| 214 if ((level >= 0) && (level < LOG_NUM_SEVERITIES)) | 215 if ((level >= 0) && (level < LOG_NUM_SEVERITIES)) |
| 215 logging::SetMinLogLevel(level); | 216 logging::SetMinLogLevel(level); |
| 216 } else { | 217 } else { |
| 217 logging::SetMinLogLevel(LOG_WARNING); | 218 logging::SetMinLogLevel(LOG_WARNING); |
| 218 } | 219 } |
| 219 | 220 |
| 220 #if defined(OS_WIN) | 221 #if defined(OS_WIN) |
| 221 // Enable trace control and transport through event tracing for Windows. | 222 // Enable trace control and transport through event tracing for Windows. |
| 222 if (env->HasEnv(env_vars::kEtwLogging)) | 223 if (env->HasEnv(env_vars::kEtwLogging)) |
| 223 logging::LogEventProvider::Initialize(kChromeTraceProviderName); | 224 logging::LogEventProvider::Initialize(kChromeTraceProviderName); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 assertions->push_back(wide_line); | 287 assertions->push_back(wide_line); |
| 287 ++assertion_count; | 288 ++assertion_count; |
| 288 } | 289 } |
| 289 } | 290 } |
| 290 log_file.close(); | 291 log_file.close(); |
| 291 | 292 |
| 292 return assertion_count; | 293 return assertion_count; |
| 293 } | 294 } |
| 294 | 295 |
| 295 } // namespace logging | 296 } // namespace logging |
| OLD | NEW |