From bb5185c5f46fc6f37b4c89cdbaef77f967020855 Mon Sep 17 00:00:00 2001 From: "cpu@google.com" Date: Fri, 29 Aug 2008 19:51:06 +0000 Subject: Adds a logging level command line switch - Adds --log-level=n with n=0,1,2,3 - Increases the default logging level from INFO to WARNING there is way too much noise there. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1547 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/common/logging_chrome.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'chrome/common/logging_chrome.cc') diff --git a/chrome/common/logging_chrome.cc b/chrome/common/logging_chrome.cc index 2fed631..232e500 100644 --- a/chrome/common/logging_chrome.cc +++ b/chrome/common/logging_chrome.cc @@ -104,6 +104,17 @@ void InitChromeLogging(const CommandLine& command_line, command_line.GetSwitchValue(switches::kLogFilterPrefix); logging::SetLogFilterPrefix(WideToUTF8(log_filter_prefix).c_str()); + // Use a minimum log level if the command line has one, otherwise set the + // default to LOG_WARNING. + std::wstring log_level = command_line.GetSwitchValue(switches::kLoggingLevel); + int level = 0; + if (StringToInt(log_level, &level)) { + if ((level >= 0) && (level < LOG_NUM_SEVERITIES)) + logging::SetMinLogLevel(level); + } else { + logging::SetMinLogLevel(LOG_WARNING); + } + chrome_logging_initialized_ = true; } -- cgit v1.1