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

Side by Side Diff: net/tools/testserver/run_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
« no previous file with comments | « net/tools/net_watcher/net_watcher.cc ('k') | net/tools/tld_cleanup/tld_cleanup.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 10 matching lines...) Expand all
21 } 21 }
22 22
23 int main(int argc, const char* argv[]) { 23 int main(int argc, const char* argv[]) {
24 base::AtExitManager at_exit_manager; 24 base::AtExitManager at_exit_manager;
25 base::MessageLoopForIO message_loop; 25 base::MessageLoopForIO message_loop;
26 26
27 // Process command line 27 // Process command line
28 CommandLine::Init(argc, argv); 28 CommandLine::Init(argc, argv);
29 CommandLine* command_line = CommandLine::ForCurrentProcess(); 29 CommandLine* command_line = CommandLine::ForCurrentProcess();
30 30
31 if (!logging::InitLogging( 31 logging::LoggingSettings settings;
32 FILE_PATH_LITERAL("testserver.log"), 32 settings.logging_dest = logging::LOG_TO_ALL;
33 logging::LOG_TO_BOTH_FILE_AND_SYSTEM_DEBUG_LOG, 33 settings.log_file = FILE_PATH_LITERAL("testserver.log");
34 logging::LOCK_LOG_FILE, 34 if (!logging::InitLogging(settings)) {
35 logging::APPEND_TO_OLD_LOG_FILE,
36 logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS)) {
37 printf("Error: could not initialize logging. Exiting.\n"); 35 printf("Error: could not initialize logging. Exiting.\n");
38 return -1; 36 return -1;
39 } 37 }
40 38
41 TestTimeouts::Initialize(); 39 TestTimeouts::Initialize();
42 40
43 if (command_line->GetSwitches().empty() || 41 if (command_line->GetSwitches().empty() ||
44 command_line->HasSwitch("help")) { 42 command_line->HasSwitch("help")) {
45 PrintUsage(); 43 PrintUsage();
46 return -1; 44 return -1;
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 UTF16ToUTF8(test_server->document_root().LossyDisplayName()).c_str()); 116 UTF16ToUTF8(test_server->document_root().LossyDisplayName()).c_str());
119 return -1; 117 return -1;
120 } 118 }
121 119
122 printf("testserver running at %s (type ctrl+c to exit)\n", 120 printf("testserver running at %s (type ctrl+c to exit)\n",
123 test_server->host_port_pair().ToString().c_str()); 121 test_server->host_port_pair().ToString().c_str());
124 122
125 message_loop.Run(); 123 message_loop.Run();
126 return 0; 124 return 0;
127 } 125 }
OLDNEW
« no previous file with comments | « net/tools/net_watcher/net_watcher.cc ('k') | net/tools/tld_cleanup/tld_cleanup.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698