From b2702ca20d68c53e53ae9627440d41f641a7c068 Mon Sep 17 00:00:00 2001 From: Nikolay Borisenko <22616990+nvborisenko@users.noreply.github.com> Date: Mon, 28 Oct 2024 21:36:43 +0300 Subject: [PATCH] [dotnet] Treat SM's logs always as Trace to avoid SM writing at Info level (#14667) --- dotnet/src/webdriver/SeleniumManager.cs | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/dotnet/src/webdriver/SeleniumManager.cs b/dotnet/src/webdriver/SeleniumManager.cs index 4b28f7862d138..60c8cd5255389 100644 --- a/dotnet/src/webdriver/SeleniumManager.cs +++ b/dotnet/src/webdriver/SeleniumManager.cs @@ -195,28 +195,12 @@ private static ResultResponse RunCommand(string fileName, string arguments) if (jsonResponse.Logs is not null) { - foreach (var entry in jsonResponse.Logs) + // Treat SM's logs always as Trace to avoid SM writing at Info level + if (_logger.IsEnabled(LogEventLevel.Trace)) { - switch (entry.Level) + foreach (var entry in jsonResponse.Logs) { - case "WARN": - if (_logger.IsEnabled(LogEventLevel.Warn)) - { - _logger.Warn(entry.Message); - } - break; - case "DEBUG": - if (_logger.IsEnabled(LogEventLevel.Debug)) - { - _logger.Debug(entry.Message); - } - break; - case "INFO": - if (_logger.IsEnabled(LogEventLevel.Info)) - { - _logger.Info(entry.Message); - } - break; + _logger.Trace($"{entry.Level} {entry.Message}"); } } }