|
|
|
@ -4,10 +4,9 @@ using Microsoft.Extensions.Logging; |
|
|
|
|
|
|
|
namespace Volo.Abp.AspNetCore.Components.WebAssembly.ExceptionHandling |
|
|
|
{ |
|
|
|
public class AbpExceptionHandlingLogger : ILogger, IDisposable |
|
|
|
public class AbpExceptionHandlingLogger : ILogger |
|
|
|
{ |
|
|
|
private readonly IServiceCollection _serviceCollection; |
|
|
|
private IServiceScope _serviceScope; |
|
|
|
private IUserExceptionInformer _userExceptionInformer; |
|
|
|
|
|
|
|
public AbpExceptionHandlingLogger(IServiceCollection serviceCollection) |
|
|
|
@ -50,8 +49,7 @@ namespace Volo.Abp.AspNetCore.Components.WebAssembly.ExceptionHandling |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
_serviceScope = serviceProvider.CreateScope(); |
|
|
|
_userExceptionInformer = _serviceScope.ServiceProvider.GetRequiredService<IUserExceptionInformer>(); |
|
|
|
_userExceptionInformer = serviceProvider.GetRequiredService<IUserExceptionInformer>(); |
|
|
|
} |
|
|
|
|
|
|
|
public virtual bool IsEnabled(LogLevel logLevel) |
|
|
|
@ -63,10 +61,5 @@ namespace Volo.Abp.AspNetCore.Components.WebAssembly.ExceptionHandling |
|
|
|
{ |
|
|
|
return NullDisposable.Instance; |
|
|
|
} |
|
|
|
|
|
|
|
public virtual void Dispose() |
|
|
|
{ |
|
|
|
_serviceScope?.Dispose(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|