From 64ccc033d48bc5b68e51afc4567efa41fb7019c9 Mon Sep 17 00:00:00 2001 From: Chomp Date: Mon, 13 Jan 2025 12:17:53 +0000 Subject: [PATCH] Implemented logger.Success --- Core/Models/Utils/ILogger.cs | 4 ++-- Core/Utils/Logging/SimpleTextLogger.cs | 6 +++++- Server/Logger/WebApplicationLogger.cs | 5 +++++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Core/Models/Utils/ILogger.cs b/Core/Models/Utils/ILogger.cs index 05db1976..a455ad5a 100644 --- a/Core/Models/Utils/ILogger.cs +++ b/Core/Models/Utils/ILogger.cs @@ -1,4 +1,4 @@ -using Core.Models.Logging; +using Core.Models.Logging; namespace Core.Models.Utils; @@ -8,7 +8,7 @@ public interface ILogger // void WriteToLogFile(string data); // void Log(string data, LogTextColor? color, string? backgroundColor = null); // void LogWithColor(string data, LogTextColor textColor, LogBackgroundColor? backgroundColor = null); - // void Success(string data); + void Success(string data); void Error(string data); void Warning(string data); void Info(string data); diff --git a/Core/Utils/Logging/SimpleTextLogger.cs b/Core/Utils/Logging/SimpleTextLogger.cs index bc2fa94b..815a2b93 100644 --- a/Core/Utils/Logging/SimpleTextLogger.cs +++ b/Core/Utils/Logging/SimpleTextLogger.cs @@ -1,4 +1,4 @@ -using Core.Models.Logging; +using Core.Models.Logging; using Core.Annotations; using ILogger = Core.Models.Utils.ILogger; @@ -7,6 +7,10 @@ namespace Core.Utils.Logging; // [Injectable(InjectionType.Singleton)] public class SimpleTextLogger : ILogger { + public void Success(string data) + { + Console.WriteLine(data); + } public void Error(string data) { diff --git a/Server/Logger/WebApplicationLogger.cs b/Server/Logger/WebApplicationLogger.cs index c12c0205..e9de500d 100644 --- a/Server/Logger/WebApplicationLogger.cs +++ b/Server/Logger/WebApplicationLogger.cs @@ -12,6 +12,11 @@ public class WebApplicationLogger : ILogger _logger = provider.CreateLogger("SptLogger"); } + public void Success(string data) + { + _logger.LogInformation(data); + } + public void Error(string data) { _logger.LogError(data);