Skip to content

Commit

Permalink
[java] allow setting chromedriver log level from system properties
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Dec 10, 2022
1 parent 6cbfbf6 commit fc3f6cc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion java/src/org/openqa/selenium/chrome/ChromeDriverService.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ public class ChromeDriverService extends DriverService {
*/
public static final String CHROME_DRIVER_LOG_PROPERTY = "webdriver.chrome.logfile";

/**
* System property that defines the log level when ChromeDriver output is logged.
*/
public static final String CHROME_DRIVER_LOG_LEVEL_PROPERTY = "webdriver.chrome.loglevel";

/**
* Boolean system property that defines whether chromedriver should append to existing log file.
*/
Expand Down Expand Up @@ -154,7 +159,7 @@ public static class Builder extends DriverService.Builder<
private boolean verbose = Boolean.getBoolean(CHROME_DRIVER_VERBOSE_LOG_PROPERTY);
private boolean silent = Boolean.getBoolean(CHROME_DRIVER_SILENT_OUTPUT_PROPERTY);
private String whitelistedIps = System.getProperty(CHROME_DRIVER_WHITELISTED_IPS_PROPERTY);
private ChromeDriverLogLevel logLevel = null;
private ChromeDriverLogLevel logLevel = ChromeDriverLogLevel.fromString(System.getProperty(CHROME_DRIVER_LOG_LEVEL_PROPERTY));

@Override
public int score(Capabilities capabilities) {
Expand Down

0 comments on commit fc3f6cc

Please sign in to comment.