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.
import org.openqa.selenium.remote.service.DriverService;
import java.io.File;
+import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URL;
import java.util.Optional;
@@ -61,6 +62,16 @@ private XpiDriverService(
this.port = port;
this.binary = binary;
this.profile = profile;
+
+ String firefoxLogFile = System.getProperty(FirefoxDriver.SystemProperty.BROWSER_LOGFILE);
+
+ if (firefoxLogFile != null) {
+ if ("/dev/stdout".equals(firefoxLogFile)) {
+ sendOutputTo(System.out);
+ } else {
+ sendOutputTo(new FileOutputStream(firefoxLogFile));
+ }
+ }
}
@Override
@@ -74,8 +85,10 @@ public void start() throws IOException {
try {
profile.setPreference(PORT_PREFERENCE, port);
addWebDriverExtension(profile);
-
profileDir = profile.layoutOnDisk();
+
+ binary.setOutputWatcher(getOutputStream());
+
binary.startProfile(profile, profileDir, "-foreground");
waitUntilAvailable();
