Chromium Code Reviews| Index: headless/lib/headless_content_main_delegate.cc |
| diff --git a/headless/lib/headless_content_main_delegate.cc b/headless/lib/headless_content_main_delegate.cc |
| index 72df5a29a65a3adaa86b5a24e36bdc028f8dce92..5b4e786524342079bffd7db49f49d8d39a873383 100644 |
| --- a/headless/lib/headless_content_main_delegate.cc |
| +++ b/headless/lib/headless_content_main_delegate.cc |
| @@ -6,6 +6,7 @@ |
| #include "base/base_switches.h" |
| #include "base/command_line.h" |
| +#include "base/environment.h" |
| #include "base/files/file_util.h" |
| #include "base/lazy_instance.h" |
| #include "base/path_service.h" |
| @@ -127,6 +128,13 @@ void HeadlessContentMainDelegate::InitLogging( |
| log_path = log_filename; |
| } |
| + std::string filename; |
| + std::unique_ptr<base::Environment> env(base::Environment::Create()); |
| + if (env->HasVar("CHROME_LOG_FILE") && |
|
Sami
2017/03/08 10:38:14
nit: no need to call HasVar since GetVar will just
irisu
2017/03/08 23:56:08
Done.
|
| + env->GetVar("CHROME_LOG_FILE", &filename) && !filename.empty()) { |
|
Sami
2017/03/08 10:38:13
Could you make this a named constant at the top of
irisu
2017/03/08 23:56:08
Done.
|
| + log_path = base::FilePath::FromUTF8Unsafe(filename); |
| + } |
| + |
| const std::string process_type = |
| command_line.GetSwitchValueASCII(switches::kProcessType); |