Commit fa62dfbe authored by skyostil's avatar skyostil Committed by Commit bot

headless: Don't delete log files in child processes

BUG=546953

Review-Url: https://codereview.chromium.org/2675853002
Cr-Commit-Position: refs/heads/master@{#447930}
parent e3f7c9aa
...@@ -23,9 +23,7 @@ extern const char kVirtualTimeBudget[]; ...@@ -23,9 +23,7 @@ extern const char kVirtualTimeBudget[];
extern const char kWindowSize[]; extern const char kWindowSize[];
// Switches which are replicated from content. // Switches which are replicated from content.
using ::switches::kEnableLogging;
using ::switches::kHostResolverRules; using ::switches::kHostResolverRules;
using ::switches::kLoggingLevel;
using ::switches::kRemoteDebuggingPort; using ::switches::kRemoteDebuggingPort;
} // namespace switches } // namespace switches
......
...@@ -113,10 +113,14 @@ void HeadlessContentMainDelegate::InitLogging( ...@@ -113,10 +113,14 @@ void HeadlessContentMainDelegate::InitLogging(
log_path = log_filename; log_path = log_filename;
} }
const std::string process_type =
command_line.GetSwitchValueASCII(switches::kProcessType);
settings.logging_dest = log_mode; settings.logging_dest = log_mode;
settings.log_file = log_path.value().c_str(); settings.log_file = log_path.value().c_str();
settings.lock_log = logging::DONT_LOCK_LOG_FILE; settings.lock_log = logging::DONT_LOCK_LOG_FILE;
settings.delete_old = logging::DELETE_OLD_LOG_FILE; settings.delete_old = process_type.empty() ? logging::DELETE_OLD_LOG_FILE
: logging::APPEND_TO_OLD_LOG_FILE;
bool success = logging::InitLogging(settings); bool success = logging::InitLogging(settings);
DCHECK(success); DCHECK(success);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment