From 798cf1c1a39ba5baf6f5ff09ad551c1f44a72c02 Mon Sep 17 00:00:00 2001 From: Nikolay Borisenko <22616990+nvborisenko@users.noreply.github.com> Date: Thu, 3 Oct 2024 22:08:47 +0300 Subject: [PATCH] [dotnet] Suppressed not yet initialized safari driver service in internal logs --- dotnet/src/webdriver/DriverService.cs | 2 +- dotnet/src/webdriver/Safari/SafariDriverService.cs | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/dotnet/src/webdriver/DriverService.cs b/dotnet/src/webdriver/DriverService.cs index 94a100e4997e1..d3f864d3d396b 100644 --- a/dotnet/src/webdriver/DriverService.cs +++ b/dotnet/src/webdriver/DriverService.cs @@ -236,7 +236,7 @@ protected virtual bool IsInitialized } catch (Exception ex) when (ex is HttpRequestException || ex is TaskCanceledException) { - // do nothing: the exception is expected, meaning driver service is not initialized + // Do nothing. The exception is expected, meaning driver service is not initialized. } return isInitialized; diff --git a/dotnet/src/webdriver/Safari/SafariDriverService.cs b/dotnet/src/webdriver/Safari/SafariDriverService.cs index 5d850c7ee3bcb..b496252ee3d14 100644 --- a/dotnet/src/webdriver/Safari/SafariDriverService.cs +++ b/dotnet/src/webdriver/Safari/SafariDriverService.cs @@ -17,7 +17,6 @@ // using OpenQA.Selenium.Internal; -using OpenQA.Selenium.Internal.Logging; using System; using System.IO; using System.Net; @@ -34,8 +33,6 @@ public sealed class SafariDriverService : DriverService { private const string DefaultSafariDriverServiceExecutableName = "safaridriver"; - private readonly static ILogger logger = Log.GetLogger(); - /// /// Initializes a new instance of the class. /// @@ -130,10 +127,7 @@ protected override bool IsInitialized // check. catch (Exception ex) when (ex is HttpRequestException || ex is TaskCanceledException) { - if (logger.IsEnabled(LogEventLevel.Trace)) - { - logger.Trace(ex.ToString()); - } + // Do nothing. The exception is expected, meaning driver service is not initialized. } } }