Skip to content

Commit fc3f6cc

Browse files
committed
[java] allow setting chromedriver log level from system properties
1 parent 6cbfbf6 commit fc3f6cc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

java/src/org/openqa/selenium/chrome/ChromeDriverService.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ public class ChromeDriverService extends DriverService {
5050
*/
5151
public static final String CHROME_DRIVER_LOG_PROPERTY = "webdriver.chrome.logfile";
5252

53+
/**
54+
* System property that defines the log level when ChromeDriver output is logged.
55+
*/
56+
public static final String CHROME_DRIVER_LOG_LEVEL_PROPERTY = "webdriver.chrome.loglevel";
57+
5358
/**
5459
* Boolean system property that defines whether chromedriver should append to existing log file.
5560
*/
@@ -154,7 +159,7 @@ public static class Builder extends DriverService.Builder<
154159
private boolean verbose = Boolean.getBoolean(CHROME_DRIVER_VERBOSE_LOG_PROPERTY);
155160
private boolean silent = Boolean.getBoolean(CHROME_DRIVER_SILENT_OUTPUT_PROPERTY);
156161
private String whitelistedIps = System.getProperty(CHROME_DRIVER_WHITELISTED_IPS_PROPERTY);
157-
private ChromeDriverLogLevel logLevel = null;
162+
private ChromeDriverLogLevel logLevel = ChromeDriverLogLevel.fromString(System.getProperty(CHROME_DRIVER_LOG_LEVEL_PROPERTY));
158163

159164
@Override
160165
public int score(Capabilities capabilities) {

0 commit comments

Comments
 (0)