Skip to content

feat(java): add webdriver.edge.loglevel#10962

Merged
diemol merged 2 commits intoSeleniumHQ:trunkfrom
hgsgtk:feat/hgsgtk/java-loglevel
Aug 22, 2022
Merged

feat(java): add webdriver.edge.loglevel#10962
diemol merged 2 commits intoSeleniumHQ:trunkfrom
hgsgtk:feat/hgsgtk/java-loglevel

Conversation

@hgsgtk
Copy link
Copy Markdown
Contributor

@hgsgtk hgsgtk commented Aug 20, 2022

Description

It adds a new system property, webdriver.edge.loglevel on EdgeDriverService.
It allows us to configure the log level in detail.

For example, if you use version 104.0.1293.63 Microsoft Edge WebDriver, you can choose one from ALL, DEBUG, INFO, WARNING, SEVERE, or OFF.

$ ./msedgedriver --help

  --log-level=LEVEL  set log level: ALL, DEBUG, INFO, WARNING, SEVERE, OFF

What this system property does is to make sure to specify the --log-level option like the others.

Detail: validation of given string

When users provide an invalid log level, MsEdgeDriver will be terminated due to an error; Invalid --log-level value.

$ ./msedgedriver --log-level=UNKNOWN
Starting Microsoft Edge WebDriver 104.0.1293.63 (7dd22b4a7f122e6953a166b0388edf494d716c7d) on port 9515
To submit feedback, report a bug, or suggest new features, please visit https://github.com/MicrosoftEdge/EdgeWebDriver

Only local connections are allowed.
Please see https://aka.ms/WebDriverSecurity for suggestions on keeping Microsoft Edge WebDriver safe.

Invalid --log-level value.
Unable to initialize logging. Exiting...

I wondered if I should validate if a given value is valid, but I didn't implement it because I was concerned that support costs would be high. For example, it is an extreme case, but we might need to have a log level list for each version when MsEdgeDriver adds or removes log levels, etc.

Motivation and Context

Fixes #10961

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
    • I skipped adding automated tests because it looks technically tricky, and other properties don't have a test.
  • All new and existing tests passed.

It adds a new system property `webdriver.edge.loglevel`
on EdgeDriverService.
It allows us to configure the log level in detail.

For example, if you use version 104.0.1293.63 Microsoft Edge WebDriver,
you can choose one from ALL, DEBUG, INFO, WARNING, SEVERE, or OFF.

```
$ ./msedgedriver --help

  --log-level=LEVEL
 set log level: ALL, DEBUG, INFO, WARNING, SEVERE, OFF
```

What this system property does is to make sure
to specify the `--log-level` option like the others.

Fixes SeleniumHQ#10961
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Aug 20, 2022

CLA assistant check
All committers have signed the CLA.

@hgsgtk hgsgtk marked this pull request as ready for review August 20, 2022 06:58
Copy link
Copy Markdown
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @hgsgtk!

@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@diemol diemol merged commit ce2ee20 into SeleniumHQ:trunk Aug 22, 2022
@hgsgtk hgsgtk deleted the feat/hgsgtk/java-loglevel branch August 23, 2022 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[🚀 Feature]: Java(EdgeDriverService): add new system property webdriver.edge.loglevel

3 participants