From 4a07526a64b3a1684171287332a98537c21bf108 Mon Sep 17 00:00:00 2001 From: Diego Molina Date: Tue, 23 Apr 2024 15:11:41 +0200 Subject: [PATCH] [dotnet] Checking if log level is enabled before logging in SM. --- dotnet/src/webdriver/SeleniumManager.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dotnet/src/webdriver/SeleniumManager.cs b/dotnet/src/webdriver/SeleniumManager.cs index f6cd2255a6ec1..b0301d5900b74 100644 --- a/dotnet/src/webdriver/SeleniumManager.cs +++ b/dotnet/src/webdriver/SeleniumManager.cs @@ -194,7 +194,10 @@ private static Dictionary RunCommand(string fileName, string arg switch (entry.Key) { case "WARN": - _logger.Warn(entry.Value); + if (_logger.IsEnabled(LogEventLevel.Warn)) + { + _logger.Warn(entry.Value); + } break; case "DEBUG": case "INFO":