diff --git a/Snowflake.Data/Client/SnowflakeDbCommand.cs b/Snowflake.Data/Client/SnowflakeDbCommand.cs index 96771da40..68d3dccb0 100755 --- a/Snowflake.Data/Client/SnowflakeDbCommand.cs +++ b/Snowflake.Data/Client/SnowflakeDbCommand.cs @@ -22,13 +22,13 @@ public class SnowflakeDbCommand : DbCommand private SnowflakeDbParameterCollection parameterCollection; - private SFLogger _logger = SFLoggerFactory.GetLogger(); + private SFLogger logger = SFLoggerFactory.GetLogger(); private readonly QueryResultsAwaiter _queryResultsAwaiter = QueryResultsAwaiter.Instance; public SnowflakeDbCommand() { - _logger.Debug("Constructing SnowflakeDbCommand class"); + logger.Debug("Constructing SnowflakeDbCommand class"); // by default, no query timeout this.CommandTimeout = 0; parameterCollection = new SnowflakeDbParameterCollection(); @@ -165,7 +165,7 @@ public override void Cancel() public override int ExecuteNonQuery() { - _logger.Debug($"ExecuteNonQuery"); + logger.Debug($"ExecuteNonQuery"); SFBaseResultSet resultSet = ExecuteInternal(); long total = 0; do @@ -190,7 +190,7 @@ public override int ExecuteNonQuery() public override async Task ExecuteNonQueryAsync(CancellationToken cancellationToken) { - _logger.Debug($"ExecuteNonQueryAsync"); + logger.Debug($"ExecuteNonQueryAsync"); cancellationToken.ThrowIfCancellationRequested(); var resultSet = await ExecuteInternalAsync(cancellationToken).ConfigureAwait(false); @@ -217,7 +217,7 @@ public override async Task ExecuteNonQueryAsync(CancellationToken cancellat public override object ExecuteScalar() { - _logger.Debug($"ExecuteScalar"); + logger.Debug($"ExecuteScalar"); SFBaseResultSet resultSet = ExecuteInternal(); if(resultSet.Next()) @@ -228,7 +228,7 @@ public override object ExecuteScalar() public override async Task ExecuteScalarAsync(CancellationToken cancellationToken) { - _logger.Debug($"ExecuteScalarAsync"); + logger.Debug($"ExecuteScalarAsync"); cancellationToken.ThrowIfCancellationRequested(); var result = await ExecuteInternalAsync(cancellationToken).ConfigureAwait(false); @@ -263,14 +263,14 @@ protected override DbParameter CreateDbParameter() protected override DbDataReader ExecuteDbDataReader(CommandBehavior behavior) { - _logger.Debug($"ExecuteDbDataReader"); + logger.Debug($"ExecuteDbDataReader"); SFBaseResultSet resultSet = ExecuteInternal(); return new SnowflakeDbDataReader(this, resultSet); } protected override async Task ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken) { - _logger.Debug($"ExecuteDbDataReaderAsync"); + logger.Debug($"ExecuteDbDataReaderAsync"); try { var result = await ExecuteInternalAsync(cancellationToken).ConfigureAwait(false); @@ -278,7 +278,7 @@ protected override async Task ExecuteDbDataReaderAsync(CommandBeha } catch (Exception ex) { - _logger.Error("The command failed to execute.", ex); + logger.Error("The command failed to execute.", ex); throw; } } @@ -290,7 +290,7 @@ protected override async Task ExecuteDbDataReaderAsync(CommandBeha /// The query id. public string ExecuteInAsyncMode() { - _logger.Debug($"ExecuteInAsyncMode"); + logger.Debug($"ExecuteInAsyncMode"); SFBaseResultSet resultSet = ExecuteInternal(asyncExec: true); return resultSet.queryId; } @@ -303,7 +303,7 @@ public string ExecuteInAsyncMode() /// The query id. public async Task ExecuteAsyncInAsyncMode(CancellationToken cancellationToken) { - _logger.Debug($"ExecuteAsyncInAsyncMode"); + logger.Debug($"ExecuteAsyncInAsyncMode"); var resultSet = await ExecuteInternalAsync(cancellationToken, asyncExec: true).ConfigureAwait(false); return resultSet.queryId; } @@ -315,7 +315,7 @@ public async Task ExecuteAsyncInAsyncMode(CancellationToken cancellation /// The query status. public QueryStatus GetQueryStatus(string queryId) { - _logger.Debug($"GetQueryStatus"); + logger.Debug($"GetQueryStatus"); return _queryResultsAwaiter.GetQueryStatus(connection, queryId); } @@ -327,7 +327,7 @@ public QueryStatus GetQueryStatus(string queryId) /// The query status. public async Task GetQueryStatusAsync(string queryId, CancellationToken cancellationToken) { - _logger.Debug($"GetQueryStatusAsync"); + logger.Debug($"GetQueryStatusAsync"); return await _queryResultsAwaiter.GetQueryStatusAsync(connection, queryId, cancellationToken); } @@ -338,7 +338,7 @@ public async Task GetQueryStatusAsync(string queryId, CancellationT /// The query results. public DbDataReader GetResultsFromQueryId(string queryId) { - _logger.Debug($"GetResultsFromQueryId"); + logger.Debug($"GetResultsFromQueryId"); Task task = _queryResultsAwaiter.RetryUntilQueryResultIsAvailable(connection, queryId, CancellationToken.None, false); task.Wait(); @@ -356,7 +356,7 @@ public DbDataReader GetResultsFromQueryId(string queryId) /// The query results. public async Task GetResultsFromQueryIdAsync(string queryId, CancellationToken cancellationToken) { - _logger.Debug($"GetResultsFromQueryIdAsync"); + logger.Debug($"GetResultsFromQueryIdAsync"); await _queryResultsAwaiter.RetryUntilQueryResultIsAvailable(connection, queryId, cancellationToken, true); @@ -464,7 +464,7 @@ private void CheckIfCommandTextIsSet() if (string.IsNullOrEmpty(CommandText)) { var errorMessage = "Unable to execute command due to command text not being set"; - _logger.Error(errorMessage); + logger.Error(errorMessage); throw new Exception(errorMessage); } } diff --git a/Snowflake.Data/Client/SnowflakeDbConnection.cs b/Snowflake.Data/Client/SnowflakeDbConnection.cs index baf71a6b7..70fa642ea 100755 --- a/Snowflake.Data/Client/SnowflakeDbConnection.cs +++ b/Snowflake.Data/Client/SnowflakeDbConnection.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 2012-2021 Snowflake Computing Inc. All rights reserved. */ @@ -16,7 +16,7 @@ namespace Snowflake.Data.Client [System.ComponentModel.DesignerCategory("Code")] public class SnowflakeDbConnection : DbConnection { - private SFLogger _logger = SFLoggerFactory.GetLogger(); + private SFLogger logger = SFLoggerFactory.GetLogger(); internal SFSession SfSession { get; set; } @@ -120,7 +120,7 @@ public void PreventPooling() throw new Exception("Session not yet created for this connection. Unable to prevent the session from pooling"); } SfSession.SetPooling(false); - _logger.Debug($"Session {SfSession.sessionId} marked not to be pooled any more"); + logger.Debug($"Session {SfSession.sessionId} marked not to be pooled any more"); } internal bool HasActiveExplicitTransaction() => ExplicitTransaction != null && ExplicitTransaction.IsActive; @@ -138,7 +138,7 @@ private bool TryToReturnSessionToPool() var sessionReturnedToPool = SnowflakeDbConnectionPool.AddSession(SfSession); if (sessionReturnedToPool) { - _logger.Debug($"Session pooled: {SfSession.sessionId}"); + logger.Debug($"Session pooled: {SfSession.sessionId}"); } return sessionReturnedToPool; } @@ -149,13 +149,13 @@ private TransactionRollbackStatus TerminateTransactionForDirtyConnectionReturnin return TransactionRollbackStatus.Success; try { - _logger.Debug("Closing dirty connection: an active transaction exists in session: " + SfSession.sessionId); + logger.Debug("Closing dirty connection: an active transaction exists in session: " + SfSession.sessionId); using (IDbCommand command = CreateCommand()) { command.CommandText = "ROLLBACK"; command.ExecuteNonQuery(); // error to indicate a problem within application code that a connection was closed while still having a pending transaction - _logger.Error("Closing dirty connection: rollback transaction in session " + SfSession.sessionId + " succeeded."); + logger.Error("Closing dirty connection: rollback transaction in session " + SfSession.sessionId + " succeeded."); ExplicitTransaction = null; return TransactionRollbackStatus.Success; } @@ -163,14 +163,14 @@ private TransactionRollbackStatus TerminateTransactionForDirtyConnectionReturnin catch (Exception exception) { // error to indicate a problem with rollback of an active transaction and inability to return dirty connection to the pool - _logger.Error("Closing dirty connection: rollback transaction in session: " + SfSession.sessionId + " failed, exception: " + exception.Message); + logger.Error("Closing dirty connection: rollback transaction in session: " + SfSession.sessionId + " failed, exception: " + exception.Message); return TransactionRollbackStatus.Failure; // connection won't be pooled } } public override void ChangeDatabase(string databaseName) { - _logger.Debug($"ChangeDatabase to:{databaseName}"); + logger.Debug($"ChangeDatabase to:{databaseName}"); string alterDbCommand = $"use database {databaseName}"; @@ -183,7 +183,7 @@ public override void ChangeDatabase(string databaseName) public override void Close() { - _logger.Debug("Close Connection."); + logger.Debug("Close Connection."); if (IsNonClosedWithSession()) { var returnedToPool = TryToReturnSessionToPool(); @@ -207,7 +207,7 @@ public override async Task CloseAsync() public virtual async Task CloseAsync(CancellationToken cancellationToken) { - _logger.Debug("Close Connection."); + logger.Debug("Close Connection."); TaskCompletionSource taskCompletionSource = new TaskCompletionSource(); if (cancellationToken.IsCancellationRequested) @@ -232,18 +232,18 @@ await SfSession.CloseAsync(cancellationToken).ContinueWith( if (previousTask.IsFaulted) { // Exception from SfSession.CloseAsync - _logger.Error("Error closing the session", previousTask.Exception); + logger.Error("Error closing the session", previousTask.Exception); taskCompletionSource.SetException(previousTask.Exception); } else if (previousTask.IsCanceled) { _connectionState = ConnectionState.Closed; - _logger.Debug("Session close canceled"); + logger.Debug("Session close canceled"); taskCompletionSource.SetCanceled(); } else { - _logger.Debug("Session closed successfully"); + logger.Debug("Session closed successfully"); _connectionState = ConnectionState.Closed; taskCompletionSource.SetResult(null); } @@ -252,7 +252,7 @@ await SfSession.CloseAsync(cancellationToken).ContinueWith( } else { - _logger.Debug("Session not opened. Nothing to do."); + logger.Debug("Session not opened. Nothing to do."); taskCompletionSource.SetResult(null); } } @@ -267,10 +267,10 @@ protected virtual bool CanReuseSession(TransactionRollbackStatus transactionRoll public override void Open() { - _logger.Debug("Open Connection."); + logger.Debug("Open Connection."); if (_connectionState != ConnectionState.Closed) { - _logger.Debug($"Open with a connection already opened: {_connectionState}"); + logger.Debug($"Open with a connection already opened: {_connectionState}"); return; } try @@ -280,14 +280,14 @@ public override void Open() SfSession = SnowflakeDbConnectionPool.GetSession(ConnectionString, Password); if (SfSession == null) throw new SnowflakeDbException(SFError.INTERNAL_ERROR, "Could not open session"); - _logger.Debug($"Connection open with pooled session: {SfSession.sessionId}"); + logger.Debug($"Connection open with pooled session: {SfSession.sessionId}"); OnSessionEstablished(); } catch (Exception e) { // Otherwise when Dispose() is called, the close request would timeout. _connectionState = ConnectionState.Closed; - _logger.Error("Unable to connect: ", e); + logger.Error("Unable to connect: ", e); if (e is SnowflakeDbException) { throw; @@ -310,10 +310,10 @@ internal void FillConnectionStringFromTomlConfigIfNotSet() public override Task OpenAsync(CancellationToken cancellationToken) { - _logger.Debug("Open Connection Async."); + logger.Debug("Open Connection Async."); if (_connectionState != ConnectionState.Closed) { - _logger.Debug($"Open with a connection already opened: {_connectionState}"); + logger.Debug($"Open with a connection already opened: {_connectionState}"); return Task.CompletedTask; } registerConnectionCancellationCallback(cancellationToken); @@ -328,7 +328,7 @@ public override Task OpenAsync(CancellationToken cancellationToken) // Exception from SfSession.OpenAsync Exception sfSessionEx = previousTask.Exception; _connectionState = ConnectionState.Closed; - _logger.Error("Unable to connect", sfSessionEx); + logger.Error("Unable to connect", sfSessionEx); throw new SnowflakeDbException( sfSessionEx, SnowflakeDbException.CONNECTION_FAILURE_SSTATE, @@ -338,14 +338,14 @@ public override Task OpenAsync(CancellationToken cancellationToken) else if (previousTask.IsCanceled) { _connectionState = ConnectionState.Closed; - _logger.Debug("Connection canceled"); + logger.Debug("Connection canceled"); throw new TaskCanceledException("Connecting was cancelled"); } else { // Only continue if the session was opened successfully SfSession = previousTask.Result; - _logger.Debug($"Connection open with pooled session: {SfSession.sessionId}"); + logger.Debug($"Connection open with pooled session: {SfSession.sessionId}"); OnSessionEstablished(); } }, TaskContinuationOptions.None); // this continuation should be executed always (even if the whole operation was canceled) because it sets the proper state of the connection @@ -409,7 +409,7 @@ protected override void Dispose(bool disposing) catch (Exception ex) { // Prevent an exception from being thrown when disposing of this object - _logger.Error("Unable to close connection", ex); + logger.Error("Unable to close connection", ex); } } else diff --git a/Snowflake.Data/Client/SnowflakeDbConnectionPool.cs b/Snowflake.Data/Client/SnowflakeDbConnectionPool.cs index a3bea367b..fcee66e1a 100644 --- a/Snowflake.Data/Client/SnowflakeDbConnectionPool.cs +++ b/Snowflake.Data/Client/SnowflakeDbConnectionPool.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved. */ diff --git a/Snowflake.Data/Client/SnowflakeDbDataReader.cs b/Snowflake.Data/Client/SnowflakeDbDataReader.cs index 24166da9c..7d475024a 100755 --- a/Snowflake.Data/Client/SnowflakeDbDataReader.cs +++ b/Snowflake.Data/Client/SnowflakeDbDataReader.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 2012-2019 Snowflake Computing Inc. All rights reserved. */ @@ -18,7 +18,7 @@ namespace Snowflake.Data.Client { public class SnowflakeDbDataReader : DbDataReader { - static private readonly SFLogger s_logger = SFLoggerFactory.GetLogger(); + static private readonly SFLogger logger = SFLoggerFactory.GetLogger(); private SnowflakeDbCommand dbCommand; diff --git a/Snowflake.Data/Client/SnowflakeDbTransaction.cs b/Snowflake.Data/Client/SnowflakeDbTransaction.cs index eda989864..539ca225a 100755 --- a/Snowflake.Data/Client/SnowflakeDbTransaction.cs +++ b/Snowflake.Data/Client/SnowflakeDbTransaction.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 2012-2019 Snowflake Computing Inc. All rights reserved. */ @@ -12,7 +12,7 @@ namespace Snowflake.Data.Client { public class SnowflakeDbTransaction : DbTransaction { - private SFLogger _logger = SFLoggerFactory.GetLogger(); + private SFLogger logger = SFLoggerFactory.GetLogger(); private IsolationLevel isolationLevel; @@ -25,19 +25,19 @@ public class SnowflakeDbTransaction : DbTransaction public SnowflakeDbTransaction(IsolationLevel isolationLevel, SnowflakeDbConnection connection) { - _logger.Debug("Begin transaction."); + logger.Debug("Begin transaction."); if (isolationLevel != IsolationLevel.ReadCommitted) { throw new SnowflakeDbException(SFError.UNSUPPORTED_FEATURE); } if (connection == null) { - _logger.Error("Transaction cannot be started for an unknown connection"); + logger.Error("Transaction cannot be started for an unknown connection"); throw new SnowflakeDbException(SFError.MISSING_CONNECTION_PROPERTY); } if (!connection.IsOpen()) { - _logger.Error("Transaction cannot be started for a closed connection"); + logger.Error("Transaction cannot be started for a closed connection"); throw new SnowflakeDbException(SFError.UNSUPPORTED_FEATURE); } @@ -71,7 +71,7 @@ protected override DbConnection DbConnection public override void Commit() { - _logger.Debug("Commit transaction."); + logger.Debug("Commit transaction."); if (!isCommittedOrRollbacked) { using (IDbCommand command = connection.CreateCommand()) @@ -85,7 +85,7 @@ public override void Commit() public override void Rollback() { - _logger.Debug("Rollback transaction."); + logger.Debug("Rollback transaction."); if (!isCommittedOrRollbacked) { using (IDbCommand command = connection.CreateCommand()) diff --git a/Snowflake.Data/Core/Authenticator/BasicAuthenticator.cs b/Snowflake.Data/Core/Authenticator/BasicAuthenticator.cs index 9ce868dd7..a26d542d3 100644 --- a/Snowflake.Data/Core/Authenticator/BasicAuthenticator.cs +++ b/Snowflake.Data/Core/Authenticator/BasicAuthenticator.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 2012-2019 Snowflake Computing Inc. All rights reserved. */ @@ -11,7 +11,7 @@ namespace Snowflake.Data.Core.Authenticator class BasicAuthenticator : BaseAuthenticator, IAuthenticator { public const string AUTH_NAME = "snowflake"; - private static readonly SFLogger s_logger = SFLoggerFactory.GetLogger(); + private static readonly SFLogger logger = SFLoggerFactory.GetLogger(); internal BasicAuthenticator(SFSession session) : base(session, AUTH_NAME) { diff --git a/Snowflake.Data/Core/Authenticator/ExternalBrowserAuthenticator.cs b/Snowflake.Data/Core/Authenticator/ExternalBrowserAuthenticator.cs index a1f352f8b..e39ec18f8 100644 --- a/Snowflake.Data/Core/Authenticator/ExternalBrowserAuthenticator.cs +++ b/Snowflake.Data/Core/Authenticator/ExternalBrowserAuthenticator.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 2012-2019 Snowflake Computing Inc. All rights reserved. */ @@ -22,7 +22,7 @@ namespace Snowflake.Data.Core.Authenticator class ExternalBrowserAuthenticator : BaseAuthenticator, IAuthenticator { public const string AUTH_NAME = "externalbrowser"; - private static readonly SFLogger s_logger = SFLoggerFactory.GetLogger(); + private static readonly SFLogger logger = SFLoggerFactory.GetLogger(); private static readonly string TOKEN_REQUEST_PREFIX = "?token="; private static readonly byte[] SUCCESS_RESPONSE = System.Text.Encoding.UTF8.GetBytes( "" + @@ -47,14 +47,14 @@ internal ExternalBrowserAuthenticator(SFSession session) : base(session, AUTH_NA /// async Task IAuthenticator.AuthenticateAsync(CancellationToken cancellationToken) { - s_logger.Info("External Browser Authentication"); + logger.Info("External Browser Authentication"); int localPort = GetRandomUnusedPort(); using (var httpListener = GetHttpListener(localPort)) { httpListener.Start(); - s_logger.Debug("Get IdpUrl and ProofKey"); + logger.Debug("Get IdpUrl and ProofKey"); string loginUrl; if (session._disableConsoleLogin) { @@ -75,37 +75,37 @@ await session.restRequester.PostAsync( loginUrl = GetLoginUrl(_proofKey, localPort); } - s_logger.Debug("Open browser"); + logger.Debug("Open browser"); StartBrowser(loginUrl); - s_logger.Debug("Get the redirect SAML request"); + logger.Debug("Get the redirect SAML request"); _successEvent = new ManualResetEvent(false); httpListener.BeginGetContext(GetContextCallback, httpListener); var timeoutInSec = int.Parse(session.properties[SFSessionProperty.BROWSER_RESPONSE_TIMEOUT]); if (!_successEvent.WaitOne(timeoutInSec * 1000)) { - s_logger.Warn("Browser response timeout"); + logger.Warn("Browser response timeout"); throw new SnowflakeDbException(SFError.BROWSER_RESPONSE_TIMEOUT, timeoutInSec); } httpListener.Stop(); } - s_logger.Debug("Send login request"); + logger.Debug("Send login request"); await base.LoginAsync(cancellationToken).ConfigureAwait(false); } /// void IAuthenticator.Authenticate() { - s_logger.Info("External Browser Authentication"); + logger.Info("External Browser Authentication"); int localPort = GetRandomUnusedPort(); using (var httpListener = GetHttpListener(localPort)) { httpListener.Start(); - s_logger.Debug("Get IdpUrl and ProofKey"); + logger.Debug("Get IdpUrl and ProofKey"); string loginUrl; if (session._disableConsoleLogin) { @@ -122,23 +122,23 @@ void IAuthenticator.Authenticate() loginUrl = GetLoginUrl(_proofKey, localPort); } - s_logger.Debug("Open browser"); + logger.Debug("Open browser"); StartBrowser(loginUrl); - s_logger.Debug("Get the redirect SAML request"); + logger.Debug("Get the redirect SAML request"); _successEvent = new ManualResetEvent(false); httpListener.BeginGetContext(GetContextCallback, httpListener); var timeoutInSec = int.Parse(session.properties[SFSessionProperty.BROWSER_RESPONSE_TIMEOUT]); if (!_successEvent.WaitOne(timeoutInSec * 1000)) { - s_logger.Warn("Browser response timeout"); + logger.Warn("Browser response timeout"); throw new SnowflakeDbException(SFError.BROWSER_RESPONSE_TIMEOUT, timeoutInSec); } httpListener.Stop(); } - s_logger.Debug("Send login request"); + logger.Debug("Send login request"); base.Login(); } @@ -163,7 +163,7 @@ private void GetContextCallback(IAsyncResult result) catch { // Ignore the exception as it does not affect the overall authentication flow - s_logger.Warn("External browser response not sent out"); + logger.Warn("External browser response not sent out"); } } @@ -193,13 +193,13 @@ private static void StartBrowser(string url) Match m = Regex.Match(url, regexStr, RegexOptions.IgnoreCase); if (!m.Success) { - s_logger.Error("Failed to start browser. Invalid url."); + logger.Error("Failed to start browser. Invalid url."); throw new SnowflakeDbException(SFError.INVALID_BROWSER_URL); } if (!Uri.IsWellFormedUriString(url, UriKind.Absolute)) { - s_logger.Error("Failed to start browser. Invalid url."); + logger.Error("Failed to start browser. Invalid url."); throw new SnowflakeDbException(SFError.INVALID_BROWSER_URL); } diff --git a/Snowflake.Data/Core/Authenticator/IAuthenticator.cs b/Snowflake.Data/Core/Authenticator/IAuthenticator.cs index 5a1ad6f3a..40a98e761 100644 --- a/Snowflake.Data/Core/Authenticator/IAuthenticator.cs +++ b/Snowflake.Data/Core/Authenticator/IAuthenticator.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 2012-2021 Snowflake Computing Inc. All rights reserved. */ @@ -45,7 +45,7 @@ internal enum SFAuthenticatorType internal abstract class BaseAuthenticator { // The logger. - private static readonly SFLogger s_logger = + private static readonly SFLogger logger = SFLoggerFactory.GetLogger(); // The name of the authenticator. diff --git a/Snowflake.Data/Core/Authenticator/KeyPairAuthenticator.cs b/Snowflake.Data/Core/Authenticator/KeyPairAuthenticator.cs index 0439deb10..2a8522dbc 100644 --- a/Snowflake.Data/Core/Authenticator/KeyPairAuthenticator.cs +++ b/Snowflake.Data/Core/Authenticator/KeyPairAuthenticator.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 2012-2021 Snowflake Computing Inc. All rights reserved. */ @@ -32,7 +32,7 @@ class KeyPairAuthenticator : BaseAuthenticator, IAuthenticator public const string AUTH_NAME = "snowflake_jwt"; // The logger. - private static readonly SFLogger s_logger = + private static readonly SFLogger logger = SFLoggerFactory.GetLogger(); // The RSA provider to use to sign the tokens @@ -57,7 +57,7 @@ async public Task AuthenticateAsync(CancellationToken cancellationToken) jwtToken = GenerateJwtToken(); // Send the http request with the generate token - s_logger.Debug("Send login request"); + logger.Debug("Send login request"); await base.LoginAsync(cancellationToken).ConfigureAwait(false); } @@ -67,7 +67,7 @@ public void Authenticate() jwtToken = GenerateJwtToken(); // Send the http request with the generate token - s_logger.Debug("Send login request"); + logger.Debug("Send login request"); base.Login(); } @@ -84,7 +84,7 @@ protected override void SetSpecializedAuthenticatorData(ref LoginRequestData dat /// The generated JWT token. private string GenerateJwtToken() { - s_logger.Info("Key-pair Authentication"); + logger.Info("Key-pair Authentication"); bool hasPkPath = session.properties.TryGetValue(SFSessionProperty.PRIVATE_KEY_FILE, out var pkPath); diff --git a/Snowflake.Data/Core/Authenticator/OAuthAuthenticator.cs b/Snowflake.Data/Core/Authenticator/OAuthAuthenticator.cs index 4b94c82e1..52cd2ab96 100644 --- a/Snowflake.Data/Core/Authenticator/OAuthAuthenticator.cs +++ b/Snowflake.Data/Core/Authenticator/OAuthAuthenticator.cs @@ -17,7 +17,7 @@ class OAuthAuthenticator : BaseAuthenticator, IAuthenticator public const string AUTH_NAME = "oauth"; // The logger. - private static readonly SFLogger s_logger = + private static readonly SFLogger logger = SFLoggerFactory.GetLogger(); ///