Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2112)

Unified Diff: chrome/common/logging_chrome.cc

Issue 1136463009: Allow --v and --log-level switches simultaneous usage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge if's. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/logging_chrome.cc
diff --git a/chrome/common/logging_chrome.cc b/chrome/common/logging_chrome.cc
index 7d265871ed6e69b2adc35799e266ee33f5786034..c8458ef9441bf01fc50c9adf3cdc10ae6cfbc12b 100644
--- a/chrome/common/logging_chrome.cc
+++ b/chrome/common/logging_chrome.cc
@@ -333,14 +333,19 @@ void InitChromeLogging(const base::CommandLine& command_line,
command_line.HasSwitch(switches::kNoErrorDialogs))
SuppressDialogs();
- // Use a minimum log level if the command line asks for one,
- // otherwise leave it at the default level (INFO).
- if (command_line.HasSwitch(switches::kLoggingLevel)) {
- std::string log_level = command_line.GetSwitchValueASCII(
- switches::kLoggingLevel);
+ // Use a minimum log level if the command line asks for one. Ignore this
+ // switch if there's vlog level switch present too (as both of these switches
+ // refer to the same underlying log level, and the vlog level switch has
+ // already been processed inside logging::InitLogging). If there is neither
+ // log level nor vlog level specified, then just leave the default level
+ // (INFO).
+ if (command_line.HasSwitch(switches::kLoggingLevel) &&
+ logging::GetMinLogLevel() >= 0) {
+ std::string log_level =
+ command_line.GetSwitchValueASCII(switches::kLoggingLevel);
int level = 0;
- if (base::StringToInt(log_level, &level) &&
- level >= 0 && level < LOG_NUM_SEVERITIES) {
+ if (base::StringToInt(log_level, &level) && level >= 0 &&
+ level < LOG_NUM_SEVERITIES) {
logging::SetMinLogLevel(level);
} else {
DLOG(WARNING) << "Bad log level: " << log_level;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698