From 3deeb6b32551ab2ed209ab361e5efcc404f91bba Mon Sep 17 00:00:00 2001 From: "evan@chromium.org" Date: Tue, 5 Oct 2010 21:53:52 +0000 Subject: logging: set the default log level to INFO Previously we'd only show LOG(WARNING) or above. This change makes us show LOG(INFO) as well. Now that we have VLOG(), we should remove LOG(INFO) for information we don't care about. Review URL: http://codereview.chromium.org/3599016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61566 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/common/logging_chrome.cc | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'chrome/common') diff --git a/chrome/common/logging_chrome.cc b/chrome/common/logging_chrome.cc index 4441c69..beab5b8 100644 --- a/chrome/common/logging_chrome.cc +++ b/chrome/common/logging_chrome.cc @@ -213,16 +213,18 @@ void InitChromeLogging(const CommandLine& command_line, command_line.HasSwitch(switches::kNoErrorDialogs)) SuppressDialogs(); - // Use a minimum log level if the command line has one, otherwise set the - // default to LOG_WARNING. - std::string log_level = command_line.GetSwitchValueASCII( - switches::kLoggingLevel); - int level = 0; - if (base::StringToInt(log_level, &level)) { - if ((level >= 0) && (level < LOG_NUM_SEVERITIES)) + // 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); + int level = 0; + if (base::StringToInt(log_level, &level) && + level >= 0 && level < LOG_NUM_SEVERITIES) { logging::SetMinLogLevel(level); - } else { - logging::SetMinLogLevel(LOG_WARNING); + } else { + LOG(WARNING) << "Bad log level: " << log_level; + } } #if defined(OS_WIN) -- cgit v1.1