From b5e34d517abb43cac81309a691b76a385cb6ec48 Mon Sep 17 00:00:00 2001 From: sam Date: Wed, 9 Oct 2024 17:29:20 +0200 Subject: [PATCH] fix: use a serilog theme that actually works on light mode. why is this not the default --- Catalogger.Backend/Extensions/StartupExtensions.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Catalogger.Backend/Extensions/StartupExtensions.cs b/Catalogger.Backend/Extensions/StartupExtensions.cs index 3ac5200..3c1b772 100644 --- a/Catalogger.Backend/Extensions/StartupExtensions.cs +++ b/Catalogger.Backend/Extensions/StartupExtensions.cs @@ -18,6 +18,7 @@ using Remora.Discord.Interactivity.Services; using Remora.Rest.Core; using Serilog; using Serilog.Events; +using Serilog.Sinks.SystemConsole.Themes; namespace Catalogger.Backend.Extensions; @@ -39,7 +40,8 @@ public static class StartupExtensions .MinimumLevel.Override("Microsoft.AspNetCore.Hosting", LogEventLevel.Warning) .MinimumLevel.Override("Microsoft.AspNetCore.Mvc", LogEventLevel.Warning) .MinimumLevel.Override("Microsoft.AspNetCore.Routing", LogEventLevel.Warning) - .WriteTo.Console(); + // The default theme doesn't support light mode + .WriteTo.Console(theme: AnsiConsoleTheme.Sixteen); // AddSerilog doesn't seem to add an ILogger to the service collection, so add that manually. builder.Services.AddSerilog().AddSingleton(Log.Logger = logCfg.CreateLogger());