Skip to content

Commit d5af6e1

Browse files
committed
No need to create another in-memory output stream, CommandLine already has one.
1 parent 4392869 commit d5af6e1

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

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

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -326,11 +326,10 @@ public void waitFor(long timeout) throws InterruptedException, IOException {
326326
* @throws IOException IO exception reading from the output stream of the firefox process
327327
*/
328328
public String getConsoleOutput() throws IOException {
329-
if (process == null || stream == null) {
329+
if (process == null) {
330330
return null;
331331
}
332-
333-
return stream instanceof CircularOutputStream ? stream.toString() : null;
332+
return process.getStdOut();
334333
}
335334

336335
public long getTimeout() {
@@ -358,13 +357,13 @@ public void quit() {
358357

359358
private OutputStream getDefaultOutputStream() throws FileNotFoundException {
360359
String firefoxLogFile = System.getProperty(FirefoxDriver.SystemProperty.BROWSER_LOGFILE);
361-
if (firefoxLogFile == null) {
362-
return new CircularOutputStream();
363-
}
364-
if ("/dev/stdout".equals(firefoxLogFile)) {
365-
return System.out;
360+
if (firefoxLogFile != null) {
361+
if ("/dev/stdout".equals(firefoxLogFile)) {
362+
return System.out;
363+
}
364+
return new FileOutputStream(firefoxLogFile);
366365
}
367-
return new MultiOutputStream(new CircularOutputStream(), new FileOutputStream(firefoxLogFile));
366+
return null;
368367
}
369368

370369
/**

0 commit comments

Comments
 (0)