diff --git a/CryptoExchange.Net/Logging/Extensions/RestApiClientLoggingExtensions.cs b/CryptoExchange.Net/Logging/Extensions/RestApiClientLoggingExtensions.cs index b5b83dbc..0b54a53d 100644 --- a/CryptoExchange.Net/Logging/Extensions/RestApiClientLoggingExtensions.cs +++ b/CryptoExchange.Net/Logging/Extensions/RestApiClientLoggingExtensions.cs @@ -7,8 +7,8 @@ namespace CryptoExchange.Net.Logging.Extensions { internal static class RestApiClientLoggingExtensions { - private static readonly Action _restApiErrorReceived; - private static readonly Action _restApiResponseReceived; + private static readonly Action _restApiErrorReceived; + private static readonly Action _restApiResponseReceived; private static readonly Action _restApiFailedToSyncTime; private static readonly Action _restApiNoApiCredentials; private static readonly Action _restApiCreatingRequest; @@ -17,15 +17,15 @@ internal static class RestApiClientLoggingExtensions static RestApiClientLoggingExtensions() { - _restApiErrorReceived = LoggerMessage.Define( + _restApiErrorReceived = LoggerMessage.Define( LogLevel.Warning, new EventId(4000, "RestApiErrorReceived"), - "[Req {RequestId}] {ResponseStatusCode} Error received in {ResponseTime}ms: {ErrorMessage}"); + "[Req {RequestId}] {ResponseStatusCode} - Error received in {ResponseTime}ms: {ErrorMessage}"); - _restApiResponseReceived = LoggerMessage.Define( + _restApiResponseReceived = LoggerMessage.Define( LogLevel.Debug, new EventId(4001, "RestApiResponseReceived"), - "[Req {RequestId}] {ResponseStatusCode} Response received in {ResponseTime}ms: {OriginalData}"); + "[Req {RequestId}] {ResponseStatusCode} - Response received in {ResponseTime}ms: {OriginalData}"); _restApiFailedToSyncTime = LoggerMessage.Define( LogLevel.Debug, @@ -45,17 +45,17 @@ static RestApiClientLoggingExtensions() _restApiSendingRequest = LoggerMessage.Define( LogLevel.Trace, new EventId(4005, "RestApiSendingRequest"), - "[Req {RequestId}] Sending {Method}{Signed} request to {RestApiUri}{Query}"); + "[Req {RequestId}] Sending {Method} {Signed} request to {RestApiUri}{Query}"); } public static void RestApiErrorReceived(this ILogger logger, int? requestId, HttpStatusCode? responseStatusCode, long responseTime, string? error) { - _restApiErrorReceived(logger, requestId, responseStatusCode, responseTime, error, null); + _restApiErrorReceived(logger, requestId, (int?)responseStatusCode, responseTime, error, null); } public static void RestApiResponseReceived(this ILogger logger, int? requestId, HttpStatusCode? responseStatusCode, long responseTime, string? originalData) { - _restApiResponseReceived(logger, requestId, responseStatusCode, responseTime, originalData, null); + _restApiResponseReceived(logger, requestId, (int?)responseStatusCode, responseTime, originalData, null); } public static void RestApiFailedToSyncTime(this ILogger logger, int requestId, string error)