OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "base/at_exit.h" | |
6 #include "base/command_line.h" | |
7 #include "base/files/file_path.h" | |
8 #include "base/logging.h" | |
9 #include "base/path_service.h" | |
5 #include "blimp/engine/app/blimp_content_main_delegate.h" | 10 #include "blimp/engine/app/blimp_content_main_delegate.h" |
6 #include "content/public/app/content_main.h" | 11 #include "content/public/app/content_main.h" |
7 | 12 |
13 namespace { | |
14 void InitLogging() { | |
15 logging::LoggingSettings settings; | |
16 base::FilePath log_filename; | |
17 PathService::Get(base::DIR_EXE, &log_filename); | |
18 log_filename = log_filename.AppendASCII("blimp_engine.log"); | |
19 settings.logging_dest = logging::LOG_TO_ALL; | |
20 settings.log_file = log_filename.value().c_str(); | |
21 settings.delete_old = logging::DELETE_OLD_LOG_FILE; | |
22 logging::InitLogging(settings); | |
23 logging::SetLogItems(true, // Process ID | |
24 true, // Thread ID | |
25 true, // Timestamp | |
26 false); // Tick count | |
27 } | |
28 } // namespace | |
29 | |
8 int main(int argc, const char** argv) { | 30 int main(int argc, const char** argv) { |
31 base::AtExitManager at_exit; | |
haibinlu
2015/12/29 00:51:45
do we need at_exit?
Kevin M
2015/12/30 23:08:48
Done.
| |
32 | |
33 base::CommandLine::Init(argc, argv); | |
haibinlu
2015/12/29 00:51:45
initlogging in bool BlimpContentMainDelegate::Basi
Kevin M
2015/12/30 23:08:49
Done.
| |
34 InitLogging(); | |
35 | |
9 blimp::engine::BlimpContentMainDelegate delegate; | 36 blimp::engine::BlimpContentMainDelegate delegate; |
10 content::ContentMainParams params(&delegate); | 37 content::ContentMainParams params(&delegate); |
11 params.argc = argc; | 38 params.argc = argc; |
12 params.argv = argv; | 39 params.argv = argv; |
13 return content::ContentMain(params); | 40 return content::ContentMain(params); |
14 } | 41 } |
OLD | NEW |