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

Unified Diff: net/tools/flip_server/flip_in_mem_edsm_server.cc

Issue 16519003: Define a LoggingSettings struct to use for InitLogging() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile error Created 7 years, 6 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 | « net/tools/flip_server/flip_config.cc ('k') | net/tools/get_server_time/get_server_time.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/flip_server/flip_in_mem_edsm_server.cc
diff --git a/net/tools/flip_server/flip_in_mem_edsm_server.cc b/net/tools/flip_server/flip_in_mem_edsm_server.cc
index 15fb9644a8cbc4fec60ed2d70364ff220ef4553a..e6c32aa02b7e8633e3f3c932117f9e254a77ca33 100644
--- a/net/tools/flip_server/flip_in_mem_edsm_server.cc
+++ b/net/tools/flip_server/flip_in_mem_edsm_server.cc
@@ -227,12 +227,11 @@ int main (int argc, char**argv)
if (cl.HasSwitch("logdest")) {
std::string log_dest_value = cl.GetSwitchValueASCII("logdest");
if (log_dest_value.compare("file") == 0) {
- g_proxy_config.log_destination_ = logging::LOG_ONLY_TO_FILE;
+ g_proxy_config.log_destination_ = logging::LOG_TO_FILE;
} else if (log_dest_value.compare("system") == 0) {
- g_proxy_config.log_destination_ = logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG;
+ g_proxy_config.log_destination_ = logging::LOG_TO_SYSTEM_DEBUG_LOG;
} else if (log_dest_value.compare("both") == 0) {
- g_proxy_config.log_destination_ =
- logging::LOG_TO_BOTH_FILE_AND_SYSTEM_DEBUG_LOG;
+ g_proxy_config.log_destination_ = logging::LOG_TO_ALL;
} else {
LOG(FATAL) << "Invalid logging destination value: " << log_dest_value;
}
@@ -243,11 +242,9 @@ int main (int argc, char**argv)
if (cl.HasSwitch("logfile")) {
g_proxy_config.log_filename_ = cl.GetSwitchValueASCII("logfile");
if (g_proxy_config.log_destination_ == logging::LOG_NONE) {
- g_proxy_config.log_destination_ = logging::LOG_ONLY_TO_FILE;
+ g_proxy_config.log_destination_ = logging::LOG_TO_FILE;
}
- } else if (g_proxy_config.log_destination_ == logging::LOG_ONLY_TO_FILE ||
- g_proxy_config.log_destination_ ==
- logging::LOG_TO_BOTH_FILE_AND_SYSTEM_DEBUG_LOG) {
+ } else if ((g_proxy_config.log_destination_ & logging::LOG_TO_FILE) != 0) {
LOG(FATAL) << "Logging destination requires a log file to be specified.";
}
@@ -272,11 +269,11 @@ int main (int argc, char**argv)
if (cl.HasSwitch("force_spdy"))
net::SMConnection::set_force_spdy(true);
- InitLogging(g_proxy_config.log_filename_.c_str(),
- g_proxy_config.log_destination_,
- logging::DONT_LOCK_LOG_FILE,
- logging::APPEND_TO_OLD_LOG_FILE,
- logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS);
+ logging::LoggingSettings settings;
+ settings.logging_dest = g_proxy_config.log_destination_;
+ settings.log_file = g_proxy_config.log_filename_.c_str();
+ settings.lock_log = logging::DONT_LOCK_LOG_FILE;
+ logging::InitLogging(settings);
LOG(INFO) << "Flip SPDY proxy started with configuration:";
LOG(INFO) << "Logging destination : " << g_proxy_config.log_destination_;
« no previous file with comments | « net/tools/flip_server/flip_config.cc ('k') | net/tools/get_server_time/get_server_time.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698