From eb9e939fc81497d936406ac2567f1ee525e1500a Mon Sep 17 00:00:00 2001 From: Guilherme Werner <guilhermewerner@tribufu.com> Date: Tue, 3 Jun 2025 20:01:16 -0300 Subject: [PATCH] Update log levels --- src/Tribufu.Example/Program.cs | 2 +- src/Tribufu.Logging/LogLevel.cs | 10 ++++------ src/Tribufu.Logging/Logger.cs | 7 +------ 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/src/Tribufu.Example/Program.cs b/src/Tribufu.Example/Program.cs index c6f9e1d..bb64876 100644 --- a/src/Tribufu.Example/Program.cs +++ b/src/Tribufu.Example/Program.cs @@ -11,7 +11,7 @@ namespace Tribufu.Test { public static async Task Main(string[] args) { - Logger.Initialize(LogLevel.All); + Logger.Initialize(LogLevel.Trace); DotEnv.Load(new DotEnvOptions(ignoreExceptions: true, envFilePaths: [".env", "../../.env"])); diff --git a/src/Tribufu.Logging/LogLevel.cs b/src/Tribufu.Logging/LogLevel.cs index f13e62c..f8cea00 100644 --- a/src/Tribufu.Logging/LogLevel.cs +++ b/src/Tribufu.Logging/LogLevel.cs @@ -7,16 +7,14 @@ namespace Tribufu.Logging { Off = 0, - Trace = 1, + Error = 1, - Debug = 2, + Warn = 2, Info = 3, - Warn = 4, + Debug = 4, - Error = 5, - - All = 6, + Trace = 5, } } diff --git a/src/Tribufu.Logging/Logger.cs b/src/Tribufu.Logging/Logger.cs index 38e01f6..764ba44 100644 --- a/src/Tribufu.Logging/Logger.cs +++ b/src/Tribufu.Logging/Logger.cs @@ -41,12 +41,7 @@ namespace Tribufu.Logging private static void Log(LogLevel level, string message, ConsoleColor color) { - if (_level == LogLevel.Off) - { - return; - } - - if (_level == LogLevel.All || level >= _level) + if (level <= _level) { var defaultColor = Console.ForegroundColor; Console.ForegroundColor = color;