[py] Add --enable-chrome-logs to chrome service args to inherit browser i/o streams #16202
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
User description
🔗 Related Issues
implements #16201 for Python
fixes #16117
fixes #13095
💥 What does this PR do?
This PR adds the
--enable-chrome-logs
argument when starting chromedriver. This allows it to inherit the i/o streams from the browser process. Without this, we have no way to suppress or redirect browser i/o streams, which results in unwanted logging going to the user's console.🔧 Implementation Notes
I added this to the chrome Service class rather than the chromium Service class because I am not sure if this is also supported by Edge, or is only relevant to Chrome.
💡 Additional Considerations
We should test to make sure this doesn't screw up any other logging features.
🔄 Types of changes
PR Type
Bug fix
Description
Add
--enable-chrome-logs
flag to Chrome service argumentsEnable browser I/O stream inheritance to suppress unwanted console logging
Override
command_line_args
method in Chrome service classDiagram Walkthrough
File Walkthrough
service.py
Add Chrome logs flag to service arguments
py/selenium/webdriver/chrome/service.py
command_line_args
method to include--enable-chrome-logs
flag