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

Unified Diff: chrome/browser/net/chrome_net_log.cc

Issue 612023003: Make --log-net-log and NetLogLogger hide cookies by default, (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix new test Created 6 years, 3 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 | chrome/browser/net/net_log_temp_file.cc » ('j') | net/base/net_log_logger_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
}
« no previous file with comments | « no previous file | chrome/browser/net/net_log_temp_file.cc » ('j') | net/base/net_log_logger_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698