Skip to content

[dotnet] have SE_DEBUG output driver logs to stderr#16903

Merged
titusfortner merged 3 commits intotrunkfrom
dotnet_driver_logs
Jan 25, 2026
Merged

[dotnet] have SE_DEBUG output driver logs to stderr#16903
titusfortner merged 3 commits intotrunkfrom
dotnet_driver_logs

Conversation

@titusfortner
Copy link
Member

@titusfortner titusfortner commented Jan 13, 2026

User description

🔗 Related Issues

.NET implementation of #16900

💥 What does this PR do?

  • When SE_DEBUG is set, driver logs are output to stderr just like selenium logs
  • Silent/Verbose/Log Level are mutually exclusive, so updated all driver classes to use conditionals for these 3.
  • Update: keeping original logic where users who pass in more than one setting get failing response
  • SuppressInitialDiagnosticInformation was 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

  • New feature (non-breaking change which adds functionality and tests!)

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

flowchart LR
  SE_DEBUG["SE_DEBUG env var set"]
  SE_DEBUG -->|"Check in all drivers"| Verbose["Enable verbose/debug logging"]
  SE_DEBUG -->|"Enable redirection"| Redirect["Redirect process output to stderr"]
  Verbose -->|"Mutually exclusive"| Silent["Silent mode"]
  Silent -->|"Fallback to"| LogLevel["Custom log level"]
  Redirect -->|"Output via"| Stderr["Console.Error.WriteLine"]
Loading

File Walkthrough

Relevant files
Enhancement
ChromiumDriverService.cs
Implement SE_DEBUG and mutually exclusive logging options

dotnet/src/webdriver/Chromium/ChromiumDriverService.cs

  • Check SE_DEBUG environment variable to enable verbose logging
  • Restructure logging options as mutually exclusive (verbose > silent >
    log level)
  • Move log level argument handling into conditional chain
  • Modernize string formatting from string.Format to string interpolation
+10/-12 
DriverService.cs
Enable process redirection and stderr logging for SE_DEBUG

dotnet/src/webdriver/DriverService.cs

  • Change EnableProcessRedirection to check SE_DEBUG environment variable
  • Implement OnDriverProcessDataReceived to output logs to stderr when
    SE_DEBUG is set
  • Convert property from auto-property to computed property
+6/-2     
FirefoxDriverService.cs
Add SE_DEBUG support and respect suppress flag                     

dotnet/src/webdriver/Firefox/FirefoxDriverService.cs

  • Check SE_DEBUG to set log level to debug
  • Implement SuppressInitialDiagnosticInformation by setting log level to
    fatal
  • Restructure logging as mutually exclusive chain (SE_DEBUG > suppress >
    log level)
  • Update EnableProcessRedirection to include base class check
+11/-3   
InternetExplorerDriverService.cs
Add SE_DEBUG support and mutually exclusive logging           

dotnet/src/webdriver/IE/InternetExplorerDriverService.cs

  • Add System namespace import
  • Check SE_DEBUG to set log level to DEBUG
  • Implement SuppressInitialDiagnosticInformation with silent flag
  • Restructure logging as mutually exclusive chain (SE_DEBUG > suppress >
    log level)
  • Modernize string formatting to string interpolation
+11/-7   
I-cleanup
LogContextManager.cs
Fix variable naming typo                                                                 

dotnet/src/webdriver/Internal/Logging/LogContextManager.cs

  • Fix typo in variable name from defaulLogHandler to defaultLogHandler
+2/-2     

@qodo-code-review
Copy link
Contributor

qodo-code-review bot commented Jan 13, 2026

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
Sensitive information exposure

Description: When SE_DEBUG is set, all driver process output is forwarded to stderr
(Console.Error.WriteLine(args.Data)), which may expose sensitive data (URLs, tokens,
cookies, local paths) into CI logs or shared terminals if the driver emits it.
DriverService.cs [351-354]

Referred Code
if (Environment.GetEnvironmentVariable("SE_DEBUG") is not null && !string.IsNullOrEmpty(args.Data))
{
    Console.Error.WriteLine(args.Data);
}
Ticket Compliance
🟡
🎫 #1234
🔴 Fix regression where click() does not trigger JavaScript in a link’s href in Selenium
2.48.x (works in 2.47.1) on Firefox 42.
Provide/ensure a reproducible test case demonstrating the alert behavior difference and
verify the fix.
🟡
🎫 #5678
🔴 Fix/mitigate repeated ChromeDriver instantiation producing "Error: ConnectFailure
(Connection refused)" on Ubuntu/Chrome/ChromeDriver as reported.
Provide guidance or code changes to prevent subsequent instantiation failures and validate
via reproduction steps.
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status:
Debug output exposure: When SE_DEBUG is set, raw driver process output is written to Console.Error, which may
expose internal details to end-users depending on how stderr is surfaced in consuming
applications.

Referred Code
if (Environment.GetEnvironmentVariable("SE_DEBUG") is not null && !string.IsNullOrEmpty(args.Data))
{
    Console.Error.WriteLine(args.Data);
}

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status:
Unsanitized log forwarding: With SE_DEBUG enabled, the implementation forwards driver logs directly to stderr without
sanitization/redaction or structured formatting, which could inadvertently emit sensitive
data contained in driver output.

Referred Code
if (Environment.GetEnvironmentVariable("SE_DEBUG") is not null && !string.IsNullOrEmpty(args.Data))
{
    Console.Error.WriteLine(args.Data);
}

Learn more about managing compliance generic rules or creating your own custom rules

  • Update
Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-code-review
Copy link
Contributor

qodo-code-review bot commented Jan 13, 2026

PR Code Suggestions ✨

Latest suggestions up to d86286b

CategorySuggestion                                                                                                                                    Impact
Possible issue
Cache debug flag and harden stderr writes

Cache the SE_DEBUG environment variable check in a static field and add
try-catch blocks around Console.Error.WriteLine to handle potential IOException
or ObjectDisposedException.

dotnet/src/webdriver/DriverService.cs [179-355]

-protected virtual internal bool EnableProcessRedirection =>
+private static readonly bool _seDebugEnabled =
     Environment.GetEnvironmentVariable("SE_DEBUG") is not null;
+
+protected virtual internal bool EnableProcessRedirection => _seDebugEnabled;
 ...
 protected virtual void OnDriverProcessDataReceived(object sender, DataReceivedEventArgs args)
 {
-    if (Environment.GetEnvironmentVariable("SE_DEBUG") is not null && !string.IsNullOrEmpty(args.Data))
+    if (_seDebugEnabled && !string.IsNullOrEmpty(args.Data))
     {
-        Console.Error.WriteLine(args.Data);
+        try
+        {
+            Console.Error.WriteLine(args.Data);
+        }
+        catch (IOException)
+        {
+            // Ignore: stderr may be unavailable/closed in some hosts.
+        }
+        catch (ObjectDisposedException)
+        {
+            // Ignore: stderr writer was disposed by the host.
+        }
     }
 }

[To ensure code accuracy, apply this suggestion manually]

Suggestion importance[1-10]: 8

__

Why: The suggestion correctly identifies a potential runtime crash when writing to Console.Error from a background thread and proposes a robust fix, which significantly improves the code's reliability.

Medium
General
Print warning only once
Suggestion Impact:The commit adjusted the warning condition to avoid printing the SE_DEBUG override warning when the configured log level is already Debug, reducing unnecessary warning output. However, it did not implement the suggested static "warn only once per process" flag.

code diff:

             if (Environment.GetEnvironmentVariable("SE_DEBUG") is not null)
             {
-                if (this.SuppressInitialDiagnosticInformation || this.LogLevel != FirefoxDriverLogLevel.Default)
+                if (this.SuppressInitialDiagnosticInformation ||
+                    (this.LogLevel != FirefoxDriverLogLevel.Default && this.LogLevel != FirefoxDriverLogLevel.Debug))
                 {
                     Console.Error.WriteLine("WARNING: Environment Variable `SE_DEBUG` is set; forcing GeckoDriver log level to DEBUG and overriding configured log level.");

Add a static boolean flag to ensure the SE_DEBUG warning for GeckoDriver is
printed only once per process, preventing repetitive output.

dotnet/src/webdriver/Firefox/FirefoxDriverService.cs [196-203]

+private static bool _seDebugGeckoWarned;
+...
 if (Environment.GetEnvironmentVariable("SE_DEBUG") is not null)
 {
-    if (this.SuppressInitialDiagnosticInformation || this.LogLevel != FirefoxDriverLogLevel.Default)
+    if (!_seDebugGeckoWarned && (this.SuppressInitialDiagnosticInformation || this.LogLevel != FirefoxDriverLogLevel.Default))
     {
+        _seDebugGeckoWarned = true;
         Console.Error.WriteLine("WARNING: Environment Variable `SE_DEBUG` is set; forcing GeckoDriver log level to DEBUG and overriding configured log level.");
     }
     argsBuilder.Append(" --log debug");
 }

[To ensure code accuracy, apply this suggestion manually]

Suggestion importance[1-10]: 7

__

Why: The suggestion correctly points out that the warning can be printed multiple times and proposes using a static flag to prevent this, which improves the user experience by reducing log noise.

Medium
Suppress repeated warning output
Suggestion Impact:The commit modified the warning condition to avoid printing the SE_DEBUG warning when the logging level is already Debug, reducing repeated warning output in that scenario. However, it did not add the suggested static flag to guarantee the warning is only printed once per process.

code diff:

             if (Environment.GetEnvironmentVariable("SE_DEBUG") is not null)
             {
-                if (this.SuppressInitialDiagnosticInformation || this.LoggingLevel != InternetExplorerDriverLogLevel.Fatal)
+                if (this.SuppressInitialDiagnosticInformation ||
+                    (this.LoggingLevel != InternetExplorerDriverLogLevel.Fatal && this.LoggingLevel != InternetExplorerDriverLogLevel.Debug))
                 {
                     Console.Error.WriteLine("WARNING: Environment Variable `SE_DEBUG` is set; forcing IEDriver log level to DEBUG and overriding configured log level.");

Add a static boolean flag to ensure the SE_DEBUG warning for IEDriver is printed
only once per process, preventing repetitive output.

dotnet/src/webdriver/IE/InternetExplorerDriverService.cs [107-114]

+private static bool _seDebugIeWarned;
+...
 if (Environment.GetEnvironmentVariable("SE_DEBUG") is not null)
 {
-    if (this.SuppressInitialDiagnosticInformation || this.LoggingLevel != InternetExplorerDriverLogLevel.Fatal)
+    if (!_seDebugIeWarned && (this.SuppressInitialDiagnosticInformation || this.LoggingLevel != InternetExplorerDriverLogLevel.Fatal))
     {
+        _seDebugIeWarned = true;
         Console.Error.WriteLine("WARNING: Environment Variable `SE_DEBUG` is set; forcing IEDriver log level to DEBUG and overriding configured log level.");
     }
     argsBuilder.Append(" -log-level=DEBUG");
 }

[To ensure code accuracy, apply this suggestion manually]

Suggestion importance[1-10]: 7

__

Why: The suggestion correctly identifies that the warning can be printed multiple times and proposes using a static flag to prevent this, which improves the user experience by reducing log noise.

Medium
Learned
best practice
Make one-time warning thread-safe

Guard the one-time warning with an atomic operation (e.g., Interlocked.Exchange)
to avoid duplicate warnings when multiple threads construct LogContextManager
concurrently.

dotnet/src/webdriver/Internal/Logging/LogContextManager.cs [28-46]

-private static bool _seDebugWarned;
+private static int _seDebugWarned;
 private readonly AsyncLocal<ILogContext?> _currentAmbientLogContext = new();
 
 public LogContextManager()
 {
     var defaultLogHandler = new TextWriterHandler(Console.Error);
 
+    var seDebug = Environment.GetEnvironmentVariable("SE_DEBUG") is not null;
+
     // Enable debug logging if SE_DEBUG environment variable is set
-    if (Environment.GetEnvironmentVariable("SE_DEBUG") is not null && !_seDebugWarned)
+    if (seDebug && Interlocked.Exchange(ref _seDebugWarned, 1) == 0)
     {
-        _seDebugWarned = true;
         Console.Error.WriteLine("WARNING: Environment Variable `SE_DEBUG` is set; Selenium is forcing verbose logging which may override user-specified settings.");
     }
-    var level = Environment.GetEnvironmentVariable("SE_DEBUG") is not null
+
+    var level = seDebug
         ? LogEventLevel.Debug
         : LogEventLevel.Warn;
 
     GlobalContext = new LogContext(level, null, null, [defaultLogHandler]);
 }
  • Apply / Chat
Suggestion importance[1-10]: 6

__

Why:
Relevant best practice - Make concurrency-sensitive static flags thread-safe (avoid racy one-time initialization/side effects).

Low
  • Update

Previous suggestions

✅ Suggestions up to commit 4db3ccd
CategorySuggestion                                                                                                                                    Impact
Possible issue
Fix AsyncLocal compilation error

Fix a compilation error by fully qualifying System.Threading.AsyncLocal since
its using directive was removed.

dotnet/src/webdriver/Internal/Logging/LogContextManager.cs [25-45]

 internal class LogContextManager
 {
     private static bool _seDebugWarned;
-    private readonly AsyncLocal<ILogContext?> _currentAmbientLogContext = new();
+    private readonly System.Threading.AsyncLocal<ILogContext?> _currentAmbientLogContext = new();
 
     public LogContextManager()
     {
         var defaultLogHandler = new TextWriterHandler(Console.Error);
 
         // Enable debug logging if SE_DEBUG environment variable is set
         if (Environment.GetEnvironmentVariable("SE_DEBUG") is not null && !_seDebugWarned)
         {
             _seDebugWarned = true;
             Console.Error.WriteLine("WARNING: Environment Variable `SE_DEBUG` is set; Selenium is forcing verbose logging which may override user-specified settings.");
         }
         var level = Environment.GetEnvironmentVariable("SE_DEBUG") is not null
             ? LogEventLevel.Debug
             : LogEventLevel.Warn;
 
         GlobalContext = new LogContext(level, null, null, [defaultLogHandler]);
     }
Suggestion importance[1-10]: 10

__

Why: The suggestion correctly identifies a compilation error introduced by removing the using System.Threading; statement while still using the AsyncLocal<T> class, which would break the build.

High
General
Avoid repeated SE_DEBUG warnings
Suggestion Impact:The change removed the second `Environment.GetEnvironmentVariable("SE_DEBUG")` check by restructuring the logic: when SE_DEBUG is set, it now appends `--verbose` inside the existing SE_DEBUG block instead of checking the environment variable again later. However, it did not implement caching the env var value in a local variable nor add a static flag to ensure the warning is printed only once.

code diff:

@@ -124,9 +124,9 @@
                 {
                     Console.Error.WriteLine("WARNING: Environment Variable `SE_DEBUG` is set; forcing ChromiumDriver --verbose and overriding --silent/--log-level settings.");
                 }
-            }
-
-            if (Environment.GetEnvironmentVariable("SE_DEBUG") is not null || this.EnableVerboseLogging)
+                argsBuilder.Append(" --verbose");
+            }
+            else if (this.EnableVerboseLogging)
             {
                 argsBuilder.Append(" --verbose");
             }

Prevent repeated SE_DEBUG warnings and environment variable lookups by caching
the check in a local variable and using a static flag to ensure the warning is
printed only once.

dotnet/src/webdriver/Chromium/ChromiumDriverService.cs [121-140]

-if (Environment.GetEnvironmentVariable("SE_DEBUG") is not null)
+var seDebug = Environment.GetEnvironmentVariable("SE_DEBUG") is not null;
+if (seDebug && !s_seDebugWarned)
 {
+    s_seDebugWarned = true;
     if (this.SuppressInitialDiagnosticInformation || this.LogLevel != ChromiumDriverLogLevel.Default)
     {
         Console.Error.WriteLine("WARNING: Environment Variable `SE_DEBUG` is set; forcing ChromiumDriver --verbose and overriding --silent/--log-level settings.");
     }
 }
 
-if (Environment.GetEnvironmentVariable("SE_DEBUG") is not null || this.EnableVerboseLogging)
+if (seDebug || this.EnableVerboseLogging)
 {
     argsBuilder.Append(" --verbose");
 }
 else if (this.SuppressInitialDiagnosticInformation)
 {
     argsBuilder.Append(" --silent");
 }
 else if (this.LogLevel != ChromiumDriverLogLevel.Default)
 {
     argsBuilder.Append($" --log-level={this.LogLevel.ToString().ToUpperInvariant()}");
 }

[Suggestion processed]

Suggestion importance[1-10]: 7

__

Why: The suggestion correctly points out that multiple calls to CommandLineArguments would cause repeated warnings and environment variable lookups, and proposes a valid improvement using a static flag to prevent this.

Medium
Suggestions up to commit 3380bcb
CategorySuggestion                                                                                                                                    Impact
Possible issue
Fix mutually exclusive logging flags

Refactor the if-else if chain for logging arguments to allow both -silent and
-log-level flags to be set simultaneously, correcting the current mutually
exclusive logic.

dotnet/src/webdriver/IE/InternetExplorerDriverService.cs [107-118]

 if (Environment.GetEnvironmentVariable("SE_DEBUG") is not null)
 {
     argsBuilder.Append(" -log-level=DEBUG");
 }
-else if (this.SuppressInitialDiagnosticInformation)
+else
 {
-    argsBuilder.Append(" -silent");
-}
-else if (this.LoggingLevel != InternetExplorerDriverLogLevel.Fatal)
-{
-    argsBuilder.Append($" -log-level={this.LoggingLevel.ToString().ToUpperInvariant()}");
+    if (this.SuppressInitialDiagnosticInformation)
+    {
+        argsBuilder.Append(" -silent");
+    }
+
+    if (this.LoggingLevel != InternetExplorerDriverLogLevel.Fatal)
+    {
+        argsBuilder.Append($" -log-level={this.LoggingLevel.ToString().ToUpperInvariant()}");
+    }
 }
Suggestion importance[1-10]: 8

__

Why: The suggestion correctly identifies a logic flaw where logging options are unintentionally mutually exclusive, which contradicts the driver's behavior and could lead to incorrect logging configurations.

Medium
High-level
Consolidate duplicated logging logic

Refactor the duplicated logging logic from ChromiumDriverService,
FirefoxDriverService, and InternetExplorerDriverService into a shared base
method to improve maintainability.

Examples:

dotnet/src/webdriver/Chromium/ChromiumDriverService.cs [121-132]
            if (Environment.GetEnvironmentVariable("SE_DEBUG") is not null || this.EnableVerboseLogging)
            {
                argsBuilder.Append(" --verbose");
            }
            else if (this.SuppressInitialDiagnosticInformation)
            {
                argsBuilder.Append(" --silent");
            }
            else if (this.LogLevel != ChromiumDriverLogLevel.Default)
            {

 ... (clipped 2 lines)
dotnet/src/webdriver/Firefox/FirefoxDriverService.cs [196-207]
            if (Environment.GetEnvironmentVariable("SE_DEBUG") is not null)
            {
                argsBuilder.Append(" --log debug");
            }
            else if (this.SuppressInitialDiagnosticInformation)
            {
                argsBuilder.Append(" --log fatal");
            }
            else if (this.LogLevel != FirefoxDriverLogLevel.Default)
            {

 ... (clipped 2 lines)

Solution Walkthrough:

Before:

// In ChromiumDriverService.cs
protected override string CommandLineArguments {
    get {
        // ...
        if (Environment.GetEnvironmentVariable("SE_DEBUG") is not null || this.EnableVerboseLogging) {
            argsBuilder.Append(" --verbose");
        } else if (this.SuppressInitialDiagnosticInformation) {
            argsBuilder.Append(" --silent");
        } else if (this.LogLevel != ChromiumDriverLogLevel.Default) {
            argsBuilder.Append($" --log-level={...}");
        }
        // ...
    }
}

// Similar logic repeated in FirefoxDriverService.cs and InternetExplorerDriverService.cs

After:

// In base DriverService.cs
protected void AppendLoggingArguments(StringBuilder argsBuilder) {
    string? arg = GetLoggingArgument();
    if (arg is not null) argsBuilder.Append(arg);
}

protected virtual string? GetLoggingArgument() {
    if (Environment.GetEnvironmentVariable("SE_DEBUG") is not null) return GetDebugLogArgument();
    if (this.SuppressInitialDiagnosticInformation) return GetSilentLogArgument();
    return GetCustomLogArgument();
}

// In ChromiumDriverService.cs
protected override string? GetDebugLogArgument() => " --verbose";
protected override string? GetSilentLogArgument() => " --silent";
// ... and so on for other drivers
Suggestion importance[1-10]: 7

__

Why: The suggestion correctly identifies duplicated conditional logic for logging across multiple driver service classes and proposes a valid refactoring to improve maintainability, which is a significant code quality improvement.

Medium
General
Cache environment variable check result

Cache the SE_DEBUG environment variable check in a static readonly field to
avoid repeated lookups within the OnDriverProcessDataReceived event handler.

dotnet/src/webdriver/DriverService.cs [349-355]

+private static readonly bool SeDebug = Environment.GetEnvironmentVariable("SE_DEBUG") is not null;
+
 protected virtual void OnDriverProcessDataReceived(object sender, DataReceivedEventArgs args)
 {
-    if (Environment.GetEnvironmentVariable("SE_DEBUG") is not null && !string.IsNullOrEmpty(args.Data))
+    if (SeDebug && !string.IsNullOrEmpty(args.Data))
     {
         Console.Error.WriteLine(args.Data);
     }
 }
Suggestion importance[1-10]: 6

__

Why: The suggestion correctly identifies a performance inefficiency by repeatedly checking an environment variable in an event handler and proposes a valid optimization by caching the result.

Low

@nvborisenko
Copy link
Member

I believe SE_DEBUG env variable should control internal logging level. And then each component can rely on the current level to understand what command arg can be included additionally. Internal logger already can be configured via env variables (?), and already writes to stderr. I think it is good idea just to implicitly add process args depending on internal log level. In future we can easily fine tune how to configure it via env vars, rather than fix all components.

@titusfortner
Copy link
Member Author

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.

@nvborisenko
Copy link
Member

This toggle already exists:

// Enable debug logging if SE_DEBUG environment variable is set
var level = Environment.GetEnvironmentVariable("SE_DEBUG") is not null
? LogEventLevel.Debug
: LogEventLevel.Warn;

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.

titusfortner and others added 2 commits January 24, 2026 23:31
…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>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

@titusfortner titusfortner merged commit 0f11c4c into trunk Jan 25, 2026
26 of 27 checks passed
@titusfortner titusfortner deleted the dotnet_driver_logs branch January 25, 2026 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants