Skip to content

Commit d566ed3

Browse files
committed
XpiDriverService should honour the same system property as ExtensionConnection
This means that we should be sniffing the log file system property, and if this is `/dev/stdout` we should output the firefox logs to stdout. This is basically what happens anyway, since DriverService logs to stderr anyway.
1 parent f48a812 commit d566ed3

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

java/client/src/org/openqa/selenium/firefox/XpiDriverService.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import org.openqa.selenium.remote.service.DriverService;
3232

3333
import java.io.File;
34+
import java.io.FileOutputStream;
3435
import java.io.IOException;
3536
import java.net.URL;
3637
import java.util.Optional;
@@ -61,6 +62,16 @@ private XpiDriverService(
6162
this.port = port;
6263
this.binary = binary;
6364
this.profile = profile;
65+
66+
String firefoxLogFile = System.getProperty(FirefoxDriver.SystemProperty.BROWSER_LOGFILE);
67+
68+
if (firefoxLogFile != null) {
69+
if ("/dev/stdout".equals(firefoxLogFile)) {
70+
sendOutputTo(System.out);
71+
} else {
72+
sendOutputTo(new FileOutputStream(firefoxLogFile));
73+
}
74+
}
6475
}
6576

6677
@Override
@@ -74,8 +85,10 @@ public void start() throws IOException {
7485
try {
7586
profile.setPreference(PORT_PREFERENCE, port);
7687
addWebDriverExtension(profile);
77-
7888
profileDir = profile.layoutOnDisk();
89+
90+
binary.setOutputWatcher(getOutputStream());
91+
7992
binary.startProfile(profile, profileDir, "-foreground");
8093

8194
waitUntilAvailable();

0 commit comments

Comments
 (0)