diff options
author | cpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-29 19:51:06 +0000 |
---|---|---|
committer | cpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-29 19:51:06 +0000 |
commit | bb5185c5f46fc6f37b4c89cdbaef77f967020855 (patch) | |
tree | 00ea61cf039fb6e3ce952096277e4eaf2b75d388 /chrome/common/logging_chrome.cc | |
parent | 6956cd63fd86015d328a3dfb669a68f34c5e21fa (diff) | |
download | chromium_src-bb5185c5f46fc6f37b4c89cdbaef77f967020855.zip chromium_src-bb5185c5f46fc6f37b4c89cdbaef77f967020855.tar.gz chromium_src-bb5185c5f46fc6f37b4c89cdbaef77f967020855.tar.bz2 |
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
Diffstat (limited to 'chrome/common/logging_chrome.cc')
-rw-r--r-- | chrome/common/logging_chrome.cc | 11 |
1 files changed, 11 insertions, 0 deletions
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; } |