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

Side by Side Diff: sync/tools/testserver/run_sync_testserver.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdio.h> 5 #include <stdio.h>
6 6
7 #include "base/at_exit.h" 7 #include "base/at_exit.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 } 69 }
70 70
71 int main(int argc, const char* argv[]) { 71 int main(int argc, const char* argv[]) {
72 base::AtExitManager at_exit_manager; 72 base::AtExitManager at_exit_manager;
73 base::MessageLoopForIO message_loop; 73 base::MessageLoopForIO message_loop;
74 74
75 // Process command line 75 // Process command line
76 CommandLine::Init(argc, argv); 76 CommandLine::Init(argc, argv);
77 CommandLine* command_line = CommandLine::ForCurrentProcess(); 77 CommandLine* command_line = CommandLine::ForCurrentProcess();
78 78
79 if (!logging::InitLogging( 79 logging::LoggingSettings settings;
80 FILE_PATH_LITERAL("sync_testserver.log"), 80 settings.logging_dest = logging::LOG_TO_ALL;
81 logging::LOG_TO_BOTH_FILE_AND_SYSTEM_DEBUG_LOG, 81 settings.log_file = FILE_PATH_LITERAL("sync_testserver.log");
82 logging::LOCK_LOG_FILE, 82 if (!logging::InitLogging(settings)) {
83 logging::APPEND_TO_OLD_LOG_FILE,
84 logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS)) {
85 printf("Error: could not initialize logging. Exiting.\n"); 83 printf("Error: could not initialize logging. Exiting.\n");
86 return -1; 84 return -1;
87 } 85 }
88 86
89 TestTimeouts::Initialize(); 87 TestTimeouts::Initialize();
90 88
91 if (command_line->HasSwitch("help")) { 89 if (command_line->HasSwitch("help")) {
92 PrintUsage(); 90 PrintUsage();
93 return 0; 91 return 0;
94 } 92 }
(...skipping 18 matching lines...) Expand all
113 printf("Error: failed to start python sync test server. Exiting.\n"); 111 printf("Error: failed to start python sync test server. Exiting.\n");
114 return -1; 112 return -1;
115 } 113 }
116 114
117 printf("Python sync test server running at %s (type ctrl+c to exit)\n", 115 printf("Python sync test server running at %s (type ctrl+c to exit)\n",
118 test_server->host_port_pair().ToString().c_str()); 116 test_server->host_port_pair().ToString().c_str());
119 117
120 message_loop.Run(); 118 message_loop.Run();
121 return 0; 119 return 0;
122 } 120 }
OLDNEW
« no previous file with comments | « sync/tools/sync_listen_notifications.cc ('k') | third_party/libjingle/overrides/initialize_module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698