Commit 8073ba19 authored by Tatiana Buldina's avatar Tatiana Buldina Committed by Commit Bot

[ChromeDriver] Include port number to logs

Bug: chromedriver:3179
Change-Id: If5d9ad3884411d7c42307793d28e88ccd33538e2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1874243Reviewed-by: default avatarJohn Chen <johnchen@chromium.org>
Commit-Queue: Tatiana Buldina <buldina@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708667}
parent 6e13483b
...@@ -276,7 +276,7 @@ Log::Level WebDriverLog::min_level() const { ...@@ -276,7 +276,7 @@ Log::Level WebDriverLog::min_level() const {
return min_level_; return min_level_;
} }
bool InitLogging() { bool InitLogging(uint16_t port) {
g_start_time = base::TimeTicks::Now().ToInternalValue(); g_start_time = base::TimeTicks::Now().ToInternalValue();
base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
...@@ -348,7 +348,7 @@ bool InitLogging() { ...@@ -348,7 +348,7 @@ bool InitLogging() {
bool res = logging::InitLogging(logging_settings); bool res = logging::InitLogging(logging_settings);
if (cmd_line->HasSwitch("log-path") && res) { if (cmd_line->HasSwitch("log-path") && res) {
VLOG(0) << "Starting " << kChromeDriverProductFullName << " " VLOG(0) << "Starting " << kChromeDriverProductFullName << " "
<< kChromeDriverVersion; << kChromeDriverVersion << " on port " << port;
VLOG(0) << GetPortProtectionMessage(); VLOG(0) << GetPortProtectionMessage();
} }
return res; return res;
......
...@@ -80,7 +80,7 @@ class WebDriverLog : public Log { ...@@ -80,7 +80,7 @@ class WebDriverLog : public Log {
}; };
// Initializes logging system for ChromeDriver. Returns true on success. // Initializes logging system for ChromeDriver. Returns true on success.
bool InitLogging(); bool InitLogging(uint16_t port);
// Creates |Log|s, |DevToolsEventListener|s, and |CommandListener|s based on // Creates |Log|s, |DevToolsEventListener|s, and |CommandListener|s based on
// logging preferences. // logging preferences.
......
...@@ -593,7 +593,7 @@ int main(int argc, char *argv[]) { ...@@ -593,7 +593,7 @@ int main(int argc, char *argv[]) {
fflush(stdout); fflush(stdout);
} }
if (!InitLogging()) { if (!InitLogging(port)) {
printf("Unable to initialize logging. Exiting...\n"); printf("Unable to initialize logging. Exiting...\n");
return 1; return 1;
} }
......
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