Switched to serilog as logging system

This commit is contained in:
Marcel Baumgartner
2023-06-21 19:15:30 +02:00
parent 1b40250750
commit 72f60ec97c
75 changed files with 211 additions and 986 deletions

View File

@@ -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

View File

@@ -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();
}
}

View File

@@ -1,5 +1,5 @@
@using Logging.Net
@using Moonlight.App.Services.Sessions
@using Moonlight.App.Services.Sessions
@using Moonlight.App.Helpers
@inherits ErrorBoundary

View File

@@ -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

View File

@@ -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)

View File

@@ -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

View File

@@ -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">

View File

@@ -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

View File

@@ -1,5 +1,4 @@
@using Moonlight.App.Helpers.Files
@using Logging.Net
@using BlazorContextMenu
@using Moonlight.App.Helpers

View File

@@ -1,5 +1,4 @@
@typeparam T
@using Logging.Net
@inherits InputBase<T>
<div class="dropdown w-100">

View File

@@ -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

View File

@@ -1,5 +1,4 @@
@using Moonlight.App.Services.Interop
@using Logging.Net
@inject ReCaptchaService ReCaptchaService

View File

@@ -1,5 +1,4 @@
@using Microsoft.AspNetCore.Components.Rendering
@using Logging.Net
@using Moonlight.App.Services
@inject SmartTranslateService SmartTranslateService