From dd824e6024b31bcdb7b662efbc59a73ec82e1008 Mon Sep 17 00:00:00 2001 From: sfc-gh-ext-simba-lf Date: Fri, 2 Feb 2024 09:19:12 -0800 Subject: [PATCH] SNOW-990111: Move where logging is executed --- .../Core/Session/EasyLoggingStarter.cs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Snowflake.Data/Core/Session/EasyLoggingStarter.cs b/Snowflake.Data/Core/Session/EasyLoggingStarter.cs index bdda53860..cd82d3904 100644 --- a/Snowflake.Data/Core/Session/EasyLoggingStarter.cs +++ b/Snowflake.Data/Core/Session/EasyLoggingStarter.cs @@ -54,21 +54,20 @@ internal EasyLoggingStarter() public virtual void Init(string configFilePathFromConnectionString) { - if (string.IsNullOrEmpty(configFilePathFromConnectionString)) - { - s_logger.Info($"Attempting to enable easy logging without a config file specified from connection string"); - } - else - { - s_logger.Info($"Attempting to enable easy logging using config file specified from connection string: {configFilePathFromConnectionString}"); - } - lock (_lockForExclusiveInit) { if (!AllowedToInitialize(configFilePathFromConnectionString)) { return; } + if (string.IsNullOrEmpty(configFilePathFromConnectionString)) + { + s_logger.Info($"Attempting to enable easy logging without a config file specified from connection string"); + } + else + { + s_logger.Info($"Attempting to enable easy logging using config file specified from connection string: {configFilePathFromConnectionString}"); + } var config = _easyLoggingConfigProvider.ProvideConfig(configFilePathFromConnectionString); if (config == null) {