diff --git a/Snowflake.Data/Core/HttpUtil.cs b/Snowflake.Data/Core/HttpUtil.cs index 7f643c927..47018949b 100755 --- a/Snowflake.Data/Core/HttpUtil.cs +++ b/Snowflake.Data/Core/HttpUtil.cs @@ -242,12 +242,12 @@ protected override async Task SendAsync(HttpRequestMessage if (response != null) { if (response.IsSuccessStatusCode) { - logger.Debug($"Success Response: {response.ToString()}"); + logger.Debug($"Success Response: StatusCode: {(int)response.StatusCode}, ReasonPhrase: '{response.ReasonPhrase}'"); return response; } else { - logger.Debug($"Failed Response: {response.ToString()}"); + logger.Debug($"Failed Response: StatusCode: {(int)response.StatusCode}, ReasonPhrase: '{response.ReasonPhrase}'"); bool isRetryable = isRetryableHTTPCode((int)response.StatusCode); if (!isRetryable) { diff --git a/Snowflake.Data/Core/RestRequester.cs b/Snowflake.Data/Core/RestRequester.cs index 31baf0fd5..2b79e349f 100644 --- a/Snowflake.Data/Core/RestRequester.cs +++ b/Snowflake.Data/Core/RestRequester.cs @@ -32,8 +32,6 @@ internal interface IRestRequester internal class RestRequester : IRestRequester { - private static SFLogger logger = SFLoggerFactory.GetLogger(); - private static readonly RestRequester instance = new RestRequester(); private RestRequester() @@ -56,7 +54,6 @@ public async Task PostAsync(IRestRequest request, CancellationToken cancel using (var response = await SendAsync(HttpMethod.Post, request, cancellationToken).ConfigureAwait(false)) { var json = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - logger.Debug($"Post response: {json}"); return JsonConvert.DeserializeObject(json); } } @@ -72,7 +69,6 @@ public async Task GetAsync(IRestRequest request, CancellationToken cancell using (HttpResponseMessage response = await GetAsync(request, cancellationToken).ConfigureAwait(false)) { var json = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - logger.Debug($"Get response: {json}"); return JsonConvert.DeserializeObject(json); } } @@ -80,15 +76,12 @@ public async Task GetAsync(IRestRequest request, CancellationToken cancell public Task GetAsync(IRestRequest request, CancellationToken cancellationToken) { HttpRequestMessage message = request.ToRequestMessage(HttpMethod.Get); - logger.Debug($"Http method: {message.ToString()}, http request message: {message.ToString()}"); return SendAsync(HttpMethod.Get, request, cancellationToken); } public HttpResponseMessage Get(IRestRequest request) { HttpRequestMessage message = request.ToRequestMessage(HttpMethod.Get); - logger.Debug($"Http method: {message.ToString()}, http request message: {message.ToString()}"); - //Run synchronous in a new thread-pool task. return Task.Run(async () => await GetAsync(request, CancellationToken.None)).Result; } diff --git a/Snowflake.Data/Snowflake.Data.csproj b/Snowflake.Data/Snowflake.Data.csproj index dc7cd8bf6..196c6b3b9 100755 --- a/Snowflake.Data/Snowflake.Data.csproj +++ b/Snowflake.Data/Snowflake.Data.csproj @@ -12,7 +12,7 @@ Snowflake Connector for .NET howryu, tchen Copyright (c) 2012-2019 Snowflake Computing Inc. All rights reserved. - 1.2.5 + 1.2.6 Full