OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 <cstdio> | 5 #include <cstdio> |
6 #include <iostream> | 6 #include <iostream> |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 logging::DONT_LOCK_LOG_FILE, | 152 logging::DONT_LOCK_LOG_FILE, |
153 logging::DELETE_OLD_LOG_FILE, | 153 logging::DELETE_OLD_LOG_FILE, |
154 logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS); | 154 logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS); |
155 if (!success) { | 155 if (!success) { |
156 PLOG(ERROR) << "Unable to initialize logging"; | 156 PLOG(ERROR) << "Unable to initialize logging"; |
157 } | 157 } |
158 logging::SetLogItems(false, // enable_process_id | 158 logging::SetLogItems(false, // enable_process_id |
159 false, // enable_thread_id | 159 false, // enable_thread_id |
160 true, // enable_timestamp | 160 true, // enable_timestamp |
161 false); // enable_tickcount | 161 false); // enable_tickcount |
| 162 if (cmd_line->HasSwitch("verbose")) { |
| 163 logging::SetMinLogLevel(logging::LOG_VERBOSE); |
| 164 } |
162 | 165 |
163 scoped_ptr<CommandExecutor> executor(new CommandExecutorImpl()); | 166 scoped_ptr<CommandExecutor> executor(new CommandExecutorImpl()); |
164 HttpHandler handler(executor.Pass(), HttpHandler::CreateCommandMap(), | 167 HttpHandler handler(executor.Pass(), HttpHandler::CreateCommandMap(), |
165 url_base); | 168 url_base); |
166 base::WaitableEvent shutdown_event(false, false); | 169 base::WaitableEvent shutdown_event(false, false); |
167 MongooseUserData user_data = { &handler, &shutdown_event }; | 170 MongooseUserData user_data = { &handler, &shutdown_event }; |
168 | 171 |
169 std::vector<std::string> args; | 172 std::vector<std::string> args; |
170 MakeMongooseOptions(port, http_threads, &args); | 173 MakeMongooseOptions(port, http_threads, &args); |
171 scoped_ptr<const char*[]> options(new const char*[args.size() + 1]); | 174 scoped_ptr<const char*[]> options(new const char*[args.size() + 1]); |
(...skipping 19 matching lines...) Expand all Loading... |
191 if (!cmd_line->HasSwitch("verbose")) { | 194 if (!cmd_line->HasSwitch("verbose")) { |
192 fclose(stdout); | 195 fclose(stdout); |
193 fclose(stderr); | 196 fclose(stderr); |
194 } | 197 } |
195 | 198 |
196 // Run until we receive command to shutdown. | 199 // Run until we receive command to shutdown. |
197 shutdown_event.Wait(); | 200 shutdown_event.Wait(); |
198 | 201 |
199 return 0; | 202 return 0; |
200 } | 203 } |
OLD | NEW |