From 233fd3278b0635b9195d5abcbebd64c5a52cee19 Mon Sep 17 00:00:00 2001 From: Toastie Date: Thu, 26 Dec 2024 19:26:54 +1300 Subject: [PATCH] Some updated logging colours --- Logger.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Logger.cs b/Logger.cs index 1a64687..1b898a7 100644 --- a/Logger.cs +++ b/Logger.cs @@ -93,7 +93,12 @@ public class Logger : ILogger Console.ResetColor(); Console.ForegroundColor = GetLogLevelColour(logLevel); + if (logLevel == LogLevel.Critical) + { + Console.BackgroundColor = ConsoleColor.DarkRed; + } Console.Write($"{DateTimeOffset.UtcNow.ToString("yyyy-MM-dd HH:mm:ss")}"); + Console.ResetColor(); Console.ForegroundColor = ConsoleColor.Gray; Console.Write("] "); @@ -124,10 +129,15 @@ public class Logger : ILogger { Console.ForegroundColor = ConsoleColor.Gray; } + else if (logLevel is LogLevel.Critical or LogLevel.Error) + { + Console.ForegroundColor = ConsoleColor.Red; + } Console.WriteLine(formatter(state, exception)); if (exception != null) { + Console.ForegroundColor = ConsoleColor.Gray; Console.WriteLine($"{exception} : {exception.Message}\n{exception.StackTrace}"); }