Switched to serilog as logging system
This commit is contained in:
@@ -8,11 +8,11 @@
|
||||
@using Moonlight.App.Services.Interop
|
||||
@using Moonlight.App.Services
|
||||
@using Moonlight.App.Exceptions
|
||||
@using Logging.Net
|
||||
@using Moonlight.App.Database.Entities
|
||||
@using Moonlight.App.Models.Misc
|
||||
@using Moonlight.App.Services.Sessions
|
||||
@using System.ComponentModel.DataAnnotations
|
||||
@using Moonlight.App.Helpers
|
||||
@using Moonlight.App.Models.Forms
|
||||
|
||||
@inject AlertService AlertService
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
@using Logging.Net
|
||||
@using Moonlight.App.Services.LogServices
|
||||
@using Moonlight.App.Services.Sessions
|
||||
|
||||
@inherits ErrorBoundary
|
||||
|
||||
@inject ErrorLogService ErrorLogService
|
||||
|
||||
@if (CurrentException is null)
|
||||
{
|
||||
@ChildContent
|
||||
}
|
||||
else if (ErrorContent is not null)
|
||||
{
|
||||
<div class="card card-flush h-md-100">
|
||||
<div class="card-body d-flex flex-column justify-content-between mt-9 bgi-no-repeat bgi-size-cover bgi-position-x-center pb-0">
|
||||
<div class="mb-10">
|
||||
<div class="fs-2hx fw-bold text-gray-800 text-center mb-13">
|
||||
<span class="me-2">
|
||||
<TL>Ooops. This component is crashed</TL>
|
||||
</span>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<TL>This component is crashed. The error has been reported to the moonlight team</TL>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="card card-flush h-md-100">
|
||||
<div class="card-body d-flex flex-column justify-content-between mt-9 bgi-no-repeat bgi-size-cover bgi-position-x-center pb-0">
|
||||
<div class="mb-10">
|
||||
<div class="fs-2hx fw-bold text-gray-800 text-center mb-13">
|
||||
<span class="me-2">
|
||||
<TL>Ooops. This component is crashed</TL>
|
||||
</span>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<TL>This component is crashed. The error has been reported to the moonlight team</TL>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@code
|
||||
{
|
||||
List<Exception> receivedExceptions = new();
|
||||
|
||||
protected override async Task OnErrorAsync(Exception exception)
|
||||
{
|
||||
receivedExceptions.Add(exception);
|
||||
|
||||
await ErrorLogService.Log(exception, x => {});
|
||||
|
||||
await base.OnErrorAsync(exception);
|
||||
}
|
||||
|
||||
public new void Recover()
|
||||
{
|
||||
receivedExceptions.Clear();
|
||||
base.Recover();
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
@using Logging.Net
|
||||
@using Moonlight.App.Services.Sessions
|
||||
@using Moonlight.App.Services.Sessions
|
||||
@using Moonlight.App.Helpers
|
||||
|
||||
@inherits ErrorBoundary
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@using Logging.Net
|
||||
@using Moonlight.App.Exceptions
|
||||
@using Moonlight.App.Exceptions
|
||||
@using Moonlight.App.Helpers
|
||||
@using Moonlight.App.Services
|
||||
@using Moonlight.App.Services.Interop
|
||||
@using Moonlight.App.Services.Sessions
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
@using Moonlight.App.Services.Interop
|
||||
@using Moonlight.App.Exceptions
|
||||
@using Moonlight.App.Services
|
||||
@using Logging.Net
|
||||
@using Moonlight.App.ApiClients.CloudPanel
|
||||
@using Moonlight.App.ApiClients.Daemon
|
||||
@using Moonlight.App.ApiClients.Modrinth
|
||||
@using Moonlight.App.ApiClients.Wings
|
||||
@using Moonlight.App.Helpers
|
||||
@inherits ErrorBoundaryBase
|
||||
|
||||
@inject AlertService AlertService
|
||||
@@ -42,7 +42,7 @@ else
|
||||
{
|
||||
if (ConfigService.DebugMode)
|
||||
{
|
||||
Logger.Warn(exception);
|
||||
Logger.Verbose(exception);
|
||||
}
|
||||
|
||||
if (exception is DisplayException displayException)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
@using Moonlight.App.Helpers.Files
|
||||
@using Moonlight.App.Helpers
|
||||
@using Logging.Net
|
||||
@using Moonlight.App.Services
|
||||
@using Moonlight.App.Services.Interop
|
||||
@using BlazorDownloadFile
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
@using Moonlight.App.Helpers.Files
|
||||
@using Logging.Net
|
||||
|
||||
<div class="badge badge-lg badge-light-primary">
|
||||
<div class="d-flex align-items-center flex-wrap">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
@using Moonlight.App.Helpers.Files
|
||||
@using Moonlight.App.Services
|
||||
@using Moonlight.App.Services.Interop
|
||||
@using Logging.Net
|
||||
@using Moonlight.App.Helpers
|
||||
|
||||
@inject ToastService ToastService
|
||||
@inject SmartTranslateService SmartTranslateService
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
@using Moonlight.App.Helpers.Files
|
||||
@using Logging.Net
|
||||
@using BlazorContextMenu
|
||||
@using Moonlight.App.Helpers
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
@typeparam T
|
||||
@using Logging.Net
|
||||
@inherits InputBase<T>
|
||||
|
||||
<div class="dropdown w-100">
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
@using Moonlight.App.Helpers.Files
|
||||
@using Moonlight.App.Services
|
||||
@using Moonlight.App.Services.Interop
|
||||
@using Logging.Net
|
||||
|
||||
@inject ToastService ToastService
|
||||
@inject SmartTranslateService SmartTranslateService
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
@using Moonlight.App.Services.Interop
|
||||
@using Logging.Net
|
||||
|
||||
@inject ReCaptchaService ReCaptchaService
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
@using Microsoft.AspNetCore.Components.Rendering
|
||||
@using Logging.Net
|
||||
@using Moonlight.App.Services
|
||||
|
||||
@inject SmartTranslateService SmartTranslateService
|
||||
|
||||
Reference in New Issue
Block a user