From 3d70ce6c09f997698f98bb5d56b8a82845d1f5b4 Mon Sep 17 00:00:00 2001 From: Genteure Date: Fri, 4 Jun 2021 23:00:50 +0800 Subject: [PATCH] Add TextFormatter --- BililiveRecorder.WPF/Program.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/BililiveRecorder.WPF/Program.cs b/BililiveRecorder.WPF/Program.cs index 3075ad6..50c8ca3 100644 --- a/BililiveRecorder.WPF/Program.cs +++ b/BililiveRecorder.WPF/Program.cs @@ -15,6 +15,7 @@ using Serilog; using Serilog.Core; using Serilog.Exceptions; using Serilog.Formatting.Compact; +using Serilog.Formatting.Display; #nullable enable namespace BililiveRecorder.WPF @@ -181,6 +182,8 @@ namespace BililiveRecorder.WPF o.DisableTaskUnobservedTaskExceptionCapture(); o.AddExceptionFilterForType(); + o.TextFormatter = new MessageTemplateTextFormatter("[{RoomId}] {Message}{NewLine}{Exception}{@ExceptionDetail:j}"); + o.MinimumBreadcrumbLevel = Serilog.Events.LogEventLevel.Debug; o.MinimumEventLevel = Serilog.Events.LogEventLevel.Error;