From fa9300ce97c7391ca24ca5bc871b59866330963b Mon Sep 17 00:00:00 2001 From: Jkorf Date: Tue, 13 Jan 2026 09:25:07 +0100 Subject: [PATCH] Removed duplicate logging for rest responses in Trace verbosity --- CryptoExchange.Net/Clients/RestApiClient.cs | 3 --- .../Extensions/RestApiClientLoggingExtensions.cs | 11 ----------- 2 files changed, 14 deletions(-) diff --git a/CryptoExchange.Net/Clients/RestApiClient.cs b/CryptoExchange.Net/Clients/RestApiClient.cs index 24d1d4f..42ef7d8 100644 --- a/CryptoExchange.Net/Clients/RestApiClient.cs +++ b/CryptoExchange.Net/Clients/RestApiClient.cs @@ -454,9 +454,6 @@ namespace CryptoExchange.Net.Clients { memoryStream.Position = 0; originalData = await reader.ReadToEndAsync().ConfigureAwait(false); - - if (_logger.IsEnabled(LogLevel.Trace)) - _logger.RestApiReceivedResponse(request.RequestId, originalData); } // Continue processing from the memory stream since the response stream is already read and we can't seek it diff --git a/CryptoExchange.Net/Logging/Extensions/RestApiClientLoggingExtensions.cs b/CryptoExchange.Net/Logging/Extensions/RestApiClientLoggingExtensions.cs index 84d3d67..b8b7d49 100644 --- a/CryptoExchange.Net/Logging/Extensions/RestApiClientLoggingExtensions.cs +++ b/CryptoExchange.Net/Logging/Extensions/RestApiClientLoggingExtensions.cs @@ -22,7 +22,6 @@ namespace CryptoExchange.Net.Logging.Extensions private static readonly Action _restApiCacheHit; private static readonly Action _restApiCacheNotHit; private static readonly Action _restApiCancellationRequested; - private static readonly Action _restApiReceivedResponse; static RestApiClientLoggingExtensions() { @@ -90,11 +89,6 @@ namespace CryptoExchange.Net.Logging.Extensions LogLevel.Debug, new EventId(4012, "RestApiCancellationRequested"), "[Req {RequestId}] Request cancelled by user"); - - _restApiReceivedResponse = LoggerMessage.Define( - LogLevel.Trace, - new EventId(4013, "RestApiReceivedResponse"), - "[Req {RequestId}] Received response: {Data}"); } @@ -161,10 +155,5 @@ namespace CryptoExchange.Net.Logging.Extensions { _restApiCancellationRequested(logger, requestId, null); } - - public static void RestApiReceivedResponse(this ILogger logger, int requestId, string? originalData) - { - _restApiReceivedResponse(logger, requestId, originalData, null); - } } }