| Index: chrome/browser/net/chrome_net_log.cc
|
| diff --git a/chrome/browser/net/chrome_net_log.cc b/chrome/browser/net/chrome_net_log.cc
|
| index bcb85614eb19604aff17b51118c478c056c3a81b..a9d368747f811f307a555e7628f63a9e50f7a13d 100644
|
| --- a/chrome/browser/net/chrome_net_log.cc
|
| +++ b/chrome/browser/net/chrome_net_log.cc
|
| @@ -21,19 +21,6 @@
|
| ChromeNetLog::ChromeNetLog()
|
| : net_log_temp_file_(new NetLogTempFile(this)) {
|
| const CommandLine* command_line = CommandLine::ForCurrentProcess();
|
| - // Adjust base log level based on command line switch, if present.
|
| - // This is done before adding any observers so the call to UpdateLogLevel when
|
| - // an observers is added will set |effective_log_level_| correctly.
|
| - if (command_line->HasSwitch(switches::kNetLogLevel)) {
|
| - std::string log_level_string =
|
| - command_line->GetSwitchValueASCII(switches::kNetLogLevel);
|
| - int command_line_log_level;
|
| - if (base::StringToInt(log_level_string, &command_line_log_level) &&
|
| - command_line_log_level >= LOG_ALL &&
|
| - command_line_log_level <= LOG_NONE) {
|
| - SetBaseLogLevel(static_cast<LogLevel>(command_line_log_level));
|
| - }
|
| - }
|
|
|
| if (command_line->HasSwitch(switches::kLogNetLog)) {
|
| base::FilePath log_path =
|
| @@ -57,6 +44,17 @@ ChromeNetLog::ChromeNetLog()
|
| } else {
|
| scoped_ptr<base::Value> constants(NetInternalsUI::GetConstants());
|
| net_log_logger_.reset(new net::NetLogLogger(file, *constants));
|
| + if (command_line->HasSwitch(switches::kNetLogLevel)) {
|
| + std::string log_level_string =
|
| + command_line->GetSwitchValueASCII(switches::kNetLogLevel);
|
| + int command_line_log_level;
|
| + if (base::StringToInt(log_level_string, &command_line_log_level) &&
|
| + command_line_log_level >= LOG_ALL &&
|
| + command_line_log_level <= LOG_NONE) {
|
| + net_log_logger_->set_log_level(
|
| + static_cast<LogLevel>(command_line_log_level));
|
| + }
|
| + }
|
| net_log_logger_->StartObserving(this);
|
| }
|
| }
|
|
|