[py][java][js] SE_DEBUG warns only when overriding user settings#17009
[py][java][js] SE_DEBUG warns only when overriding user settings#17009titusfortner merged 2 commits intotrunkfrom
Conversation
User description🔗 Related Issues💥 What does this PR do?Updates SE_DEBUG warning messages across Python, Java, JavaScript when there are actual conflicts with user-specified settings. 🔧 Implementation NotesJava:
Python:
JavaScript:
🔄 Types of changes
PR TypeBug fix Description
Diagram Walkthroughflowchart LR
A["SE_DEBUG environment variable set"] --> B["Check for user-specified settings"]
B --> C["logLevel/silent/log-level/log-file configured"]
C --> D["Emit warning message"]
B --> E["No user settings configured"]
E --> F["Skip warning, apply defaults silently"]
|
| Relevant files | |||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Bug fix | 11 files
|
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||||||||||||
There was a problem hiding this comment.
Pull request overview
This PR tightens SE_DEBUG behavior across Python, Java, and JavaScript so that verbose driver/Grid logging and stderr redirection only emit warnings when they actually override user-configured logging settings. It also standardizes SE_DEBUG messaging across bindings while preserving existing default logging behavior when no conflicts exist.
Changes:
- Python: update Chromium, Firefox, and IE Service classes plus
selenium.webdriverimport-time logic to detect SE_DEBUG, remove conflicting logging arguments, redirect driver output tostderr, and warn only when overriding user-provided log args or outputs. - Java: extend
Debug.isDebugAll,DriverService.Builder.parseLogOutput,LoggingOptions, and the Chrome/Edge/Gecko driver service builders to print explicit SE_DEBUG warnings when forcing verbose/debug logging or stderr output over user/system properties. - JavaScript: augment
logging.jsto emit a one-time SE_DEBUG warning at module load when verbose logging is enabled and may override user-specified logging settings.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
py/selenium/webdriver/ie/service.py |
Adds SE_DEBUG-aware handling that removes conflicting --log-level/--log-file args, forces --log-level=DEBUG, redirects IE driver logs to stderr, and logs a warning only when a user-specified log level or output exists. |
py/selenium/webdriver/firefox/service.py |
Updates Firefox Service to detect SE_DEBUG, clean existing --log arguments, force --log debug with stderr output, and warn when these changes override either service args or an explicit log_output. |
py/selenium/webdriver/chromium/service.py |
Enhances Chromium Service to treat SE_DEBUG as forcing --verbose with stderr, removing existing log-level/log-path/silent args and warning when either those args or log_output would be overridden. |
py/selenium/webdriver/__init__.py |
On import, when SE_DEBUG is set, configures the root Selenium Python logger for DEBUG and emits a warning that verbose logging may override user-specified settings. |
javascript/selenium-webdriver/lib/logging.js |
Introduces a module-level seDebugWarningEmitted flag and logs a one-time SE_DEBUG warning when enabling verbose logging in Node environments. |
java/src/org/openqa/selenium/internal/Debug.java |
Extends isDebugAll() to print a single process-wide SE_DEBUG warning using an AtomicBoolean guard while preserving the existing boolean check on the environment variable. |
java/src/org/openqa/selenium/remote/service/DriverService.java |
Adjusts parseLogOutput so that when SE_DEBUG is set and no driver log property is configured, logs a warning about defaulting driver log output to stderr before applying that default. |
java/src/org/openqa/selenium/grid/log/LoggingOptions.java |
In SE_DEBUG mode, now warns when forcing Grid log level to FINE and when defaulting Grid log output to stderr instead of stdout if no log file is configured. |
java/src/org/openqa/selenium/firefox/GeckoDriverService.java |
In the builder’s loadSystemProperties, adds a SE_DEBUG-specific warning when an explicit log level or log-level property is present but will be overridden by forcing GeckoDriver to DEBUG. |
java/src/org/openqa/selenium/edge/EdgeDriverService.java |
Extends loadSystemProperties to warn when SE_DEBUG forces --verbose and overrides any existing silent/log-level configuration for EdgeDriver. |
java/src/org/openqa/selenium/chrome/ChromeDriverService.java |
Mirrors Edge behavior for ChromeDriver by warning when SE_DEBUG-driven --verbose overrides silent/log-level configuration, while keeping existing verbose/silent precedence intact. |
🔗 Related Issues
Related to #16901 and #16903
💥 What does this PR do?
Updates SE_DEBUG warning messages across Python, Java, JavaScript when there are actual conflicts with user-specified settings.
🔧 Implementation Notes
Java:
Python:
JavaScript:
🔄 Types of changes