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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 329 // Variable or by the Command Line Switch. This is for | 329 // Variable or by the Command Line Switch. This is for |
| 330 // automated test purposes. | 330 // automated test purposes. |
| 331 scoped_ptr<base::Environment> env(base::Environment::Create()); | 331 scoped_ptr<base::Environment> env(base::Environment::Create()); |
| 332 if (env->HasVar(env_vars::kHeadless) || | 332 if (env->HasVar(env_vars::kHeadless) || |
| 333 command_line.HasSwitch(switches::kNoErrorDialogs)) | 333 command_line.HasSwitch(switches::kNoErrorDialogs)) |
| 334 SuppressDialogs(); | 334 SuppressDialogs(); |
| 335 | 335 |
| 336 // Use a minimum log level if the command line asks for one, | 336 // Use a minimum log level if the command line asks for one, |
| 337 // otherwise leave it at the default level (INFO). | 337 // otherwise leave it at the default level (INFO). |
| 338 if (command_line.HasSwitch(switches::kLoggingLevel)) { | 338 if (command_line.HasSwitch(switches::kLoggingLevel)) { |
| 339 std::string log_level = command_line.GetSwitchValueASCII( | 339 // Use this switch unless the vlogging level was specified in the command |
| 340 switches::kLoggingLevel); | 340 // line by another switch. |
| 341 int level = 0; | 341 if (logging::GetMinLogLevel() >= 0) { |
|
Lei Zhang
2015/05/14 02:31:31
Do this in the same if statement as the command_li
emaxx
2015/05/15 12:59:42
Done.
| |
| 342 if (base::StringToInt(log_level, &level) && | 342 std::string log_level = |
| 343 level >= 0 && level < LOG_NUM_SEVERITIES) { | 343 command_line.GetSwitchValueASCII(switches::kLoggingLevel); |
| 344 logging::SetMinLogLevel(level); | 344 int level = 0; |
| 345 } else { | 345 if (base::StringToInt(log_level, &level) && level >= 0 && |
| 346 DLOG(WARNING) << "Bad log level: " << log_level; | 346 level < LOG_NUM_SEVERITIES) { |
| 347 logging::SetMinLogLevel(level); | |
| 348 } else { | |
| 349 DLOG(WARNING) << "Bad log level: " << log_level; | |
| 350 } | |
| 347 } | 351 } |
| 348 } | 352 } |
| 349 | 353 |
| 350 #if defined(OS_WIN) | 354 #if defined(OS_WIN) |
| 351 // Enable trace control and transport through event tracing for Windows. | 355 // Enable trace control and transport through event tracing for Windows. |
| 352 logging::LogEventProvider::Initialize(kChromeTraceProviderName); | 356 logging::LogEventProvider::Initialize(kChromeTraceProviderName); |
| 353 #endif | 357 #endif |
| 354 | 358 |
| 355 chrome_logging_initialized_ = true; | 359 chrome_logging_initialized_ = true; |
| 356 } | 360 } |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 399 time_deets.year, | 403 time_deets.year, |
| 400 time_deets.month, | 404 time_deets.month, |
| 401 time_deets.day_of_month, | 405 time_deets.day_of_month, |
| 402 time_deets.hour, | 406 time_deets.hour, |
| 403 time_deets.minute, | 407 time_deets.minute, |
| 404 time_deets.second); | 408 time_deets.second); |
| 405 return base_path.InsertBeforeExtensionASCII(suffix); | 409 return base_path.InsertBeforeExtensionASCII(suffix); |
| 406 } | 410 } |
| 407 | 411 |
| 408 } // namespace logging | 412 } // namespace logging |
| OLD | NEW |