Adjusting the Log Level

This commit is contained in:
huiyadanli 2023-10-05 18:40:20 +08:00
parent 2fe46f46a8
commit 21d7a30023
2 changed files with 13 additions and 0 deletions

View File

@ -11,7 +11,9 @@ using System.IO;
using System.Windows;
using BetterGenshinImpact.ViewModel.Pages;
using Microsoft.Extensions.Configuration;
using Serilog.Events;
using Wpf.Ui;
using Serilog.Filters;
namespace BetterGenshinImpact
{
@ -36,6 +38,9 @@ namespace BetterGenshinImpact
Log.Logger = new LoggerConfiguration()
.WriteTo.File(path: logFile, outputTemplate: "[{Timestamp:HH:mm:ss.fff}] [{Level:u3}] {SourceContext}{NewLine}{Message}{NewLine}{Exception}{NewLine}", rollingInterval: RollingInterval.Day)
.MinimumLevel.Information()
.MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
.MinimumLevel.Override("Microsoft.Hosting.Lifetime", LogEventLevel.Warning)
.WriteTo.RichTextBox(MaskWindow.Instance().LogBox, outputTemplate: "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}")
.CreateLogger();
services.AddLogging(c => c.AddSerilog());

View File

@ -10,6 +10,14 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<None Remove="Assets\drag.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Assets\drag.png" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.1" />
<PackageReference Include="H.InputSimulator" Version="1.4.0" />