Skip to content

Commit

Permalink
fix: threads solving
Browse files Browse the repository at this point in the history
  • Loading branch information
SergInLoff committed Apr 1, 2024
1 parent 6c907e9 commit 8c027eb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public static IApplicationBuilder UseJsonRpc(this IApplicationBuilder app)
/// <param name="app"></param>
/// <returns></returns>
[ExcludeFromCodeCoverage(Justification = "it's almost impossible to test UseMiddleware")]
public static IApplicationBuilder WithJsonRpcResponseErrorHandling(this IApplicationBuilder app) => app.UseMiddleware<JsonRpcErrorLoggingMiddleware>();
public static IApplicationBuilder WithJsonRpcResponseErrorLogging(this IApplicationBuilder app) => app.UseMiddleware<JsonRpcErrorLoggingMiddleware>();

private static IServiceCollection TryAddConvention<T>(this IServiceCollection serviceCollection)
where T : class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class JsonRpcErrorLoggingMiddleware
private readonly RequestDelegate next;

/// <summary> </summary>
public JsonRpcErrorLoggingMiddleware(RequestDelegate next, Logger<JsonRpcErrorLoggingMiddleware> logger)
public JsonRpcErrorLoggingMiddleware(RequestDelegate next, ILogger<JsonRpcErrorLoggingMiddleware> logger)
{
this.next = next;
this.logger = logger;
Expand All @@ -31,7 +31,7 @@ public async Task InvokeAsync(HttpContext httpContext)
var response = httpContext.GetJsonRpcResponse() as UntypedErrorResponse;
if (response?.Error != null)
{
logger.LogError("JsonRpc Error: Id = {ResponseId} Code = {Code}, Message = {Message}, Data = {Data}", response.Id, response.Error.Code, response.Error.Message, response.Error.Data?.ToString());
logger.LogInformation("JsonRpc Error: Id = {ResponseId}, Code = {Code}, Message = {Message}, Data = {Data}", response.Id, response.Error.Code, response.Error.Message, response.Error.Data?.ToString());
}
}
}
4 changes: 2 additions & 2 deletions src/Tochka.JsonRpc.Server/PublicAPI.Shipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ Tochka.JsonRpc.Server.Middlewares.JsonRpcRequestLoggingMiddleware.Invoke(Microso
Tochka.JsonRpc.Server.Middlewares.JsonRpcRequestLoggingMiddleware.JsonRpcRequestLoggingMiddleware(Microsoft.AspNetCore.Http.RequestDelegate! next, Microsoft.Extensions.Logging.ILogger<Tochka.JsonRpc.Server.Middlewares.JsonRpcRequestLoggingMiddleware!>! log) -> void
Tochka.JsonRpc.Server.Middlewares.JsonRpcErrorLoggingMiddleware
Tochka.JsonRpc.Server.Middlewares.JsonRpcErrorLoggingMiddleware.InvokeAsync(Microsoft.AspNetCore.Http.HttpContext! httpContext) -> System.Threading.Tasks.Task!
Tochka.JsonRpc.Server.Middlewares.JsonRpcErrorLoggingMiddleware.JsonRpcErrorLoggingMiddleware(Microsoft.AspNetCore.Http.RequestDelegate! next, Microsoft.Extensions.Logging.Logger<Tochka.JsonRpc.Server.Middlewares.JsonRpcErrorLoggingMiddleware!>! logger) -> void
Tochka.JsonRpc.Server.Middlewares.JsonRpcErrorLoggingMiddleware.JsonRpcErrorLoggingMiddleware(Microsoft.AspNetCore.Http.RequestDelegate! next, Microsoft.Extensions.Logging.ILogger<Tochka.JsonRpc.Server.Middlewares.JsonRpcErrorLoggingMiddleware!>! logger) -> void
static Tochka.JsonRpc.Server.Extensions.DependencyInjectionExtensions.WithJsonRpcRequestLogging(this Microsoft.AspNetCore.Builder.IApplicationBuilder! app) -> Microsoft.AspNetCore.Builder.IApplicationBuilder!
static Tochka.JsonRpc.Server.Extensions.DependencyInjectionExtensions.WithJsonRpcResponseErrorHandling(this Microsoft.AspNetCore.Builder.IApplicationBuilder! app) -> Microsoft.AspNetCore.Builder.IApplicationBuilder!
static Tochka.JsonRpc.Server.Extensions.DependencyInjectionExtensions.WithJsonRpcResponseErrorLogging(this Microsoft.AspNetCore.Builder.IApplicationBuilder! app) -> Microsoft.AspNetCore.Builder.IApplicationBuilder!
Tochka.JsonRpc.Server.Settings.JsonRpcServerOptions.LogExceptions.get -> bool
Tochka.JsonRpc.Server.Settings.JsonRpcServerOptions.LogExceptions.set -> void

0 comments on commit 8c027eb

Please sign in to comment.