[dotnet] have SE_DEBUG output driver logs to stderr#16903
[dotnet] have SE_DEBUG output driver logs to stderr#16903titusfortner merged 3 commits intotrunkfrom
Conversation
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 ✨Latest suggestions up to d86286b
Previous suggestions✅ Suggestions up to commit 4db3ccd
Suggestions up to commit 3380bcb
|
||||||||||||||||||||||||||||||||||||||||||||
|
I believe |
|
The goal is to have an easy toggle to get driver output in CI logs. Just making sure this implementation makes sense for .NET. Plus I wanted to highlight the slightly changed service logic. |
|
This toggle already exists: selenium/dotnet/src/webdriver/Internal/Logging/LogContextManager.cs Lines 34 to 37 in 1a8200f |
There was a problem hiding this comment.
Pull request overview
This PR implements SE_DEBUG environment variable support for .NET Selenium, mirroring the functionality added in the Java implementation (PR #16900). When SE_DEBUG is set, driver logs are automatically output to stderr for debugging purposes, and logging settings are restructured to be mutually exclusive.
Changes:
- Adds SE_DEBUG environment variable support to enable debug logging across all .NET drivers
- Restructures logging options to be mutually exclusive (SE_DEBUG > SuppressInitialDiagnosticInformation > LogLevel)
- Fixes Firefox driver to properly respect the SuppressInitialDiagnosticInformation setting from the base class
- Updates string formatting from string.Format to modern string interpolation
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| LogContextManager.cs | Fixed typo in variable name (defaulLogHandler → defaultLogHandler) |
| DriverService.cs | Added SE_DEBUG check to EnableProcessRedirection property and implemented OnDriverProcessDataReceived to output logs to stderr |
| ChromiumDriverService.cs | Implemented SE_DEBUG support with mutually exclusive logging chain and modernized string formatting |
| FirefoxDriverService.cs | Added SE_DEBUG support, implemented SuppressInitialDiagnosticInformation respect, and updated EnableProcessRedirection to include base class check |
| InternetExplorerDriverService.cs | Added SE_DEBUG support with mutually exclusive logging chain and modernized string formatting |
3380bcb to
4db3ccd
Compare
…ings When SE_DEBUG environment variable is set: - Forces verbose/debug logging for driver processes - Redirects driver output to stderr - Only warns when overriding user-specified log settings Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
dc98f18 to
d86286b
Compare
User description
🔗 Related Issues
.NET implementation of #16900
💥 What does this PR do?
SE_DEBUGis set, driver logs are output to stderr just like selenium logsSilent/Verbose/Log Level are mutually exclusive, so updated all driver classes to use conditionals for these 3.SuppressInitialDiagnosticInformationwas in superclass but Firefox was ignoring it, now it won't🔧 Implementation Notes
Could change the order of verbose then silent, then log level but that seems best.🔄 Types of changes
PR Type
Enhancement
Description
Implement SE_DEBUG environment variable to output driver logs to stderr
Make verbose, silent, and log level settings mutually exclusive
Ensure Firefox respects SuppressInitialDiagnosticInformation setting
Enable process redirection when SE_DEBUG is set across all drivers
Diagram Walkthrough
File Walkthrough
ChromiumDriverService.cs
Implement SE_DEBUG and mutually exclusive logging optionsdotnet/src/webdriver/Chromium/ChromiumDriverService.cs
log level)
DriverService.cs
Enable process redirection and stderr logging for SE_DEBUGdotnet/src/webdriver/DriverService.cs
SE_DEBUG is set
FirefoxDriverService.cs
Add SE_DEBUG support and respect suppress flagdotnet/src/webdriver/Firefox/FirefoxDriverService.cs
fatal
log level)
InternetExplorerDriverService.cs
Add SE_DEBUG support and mutually exclusive loggingdotnet/src/webdriver/IE/InternetExplorerDriverService.cs
log level)
LogContextManager.cs
Fix variable naming typodotnet/src/webdriver/Internal/Logging/LogContextManager.cs