namespace DaggerFramework.Utils { public class Logger { public static Action? OnLog; public Logger(string className) { _className = className; } public void Info(object what) { LogType logType = LogType.Info; string message = $"({DateFormat}) [{logType.ToString().ToUpper()}/{_className}] {what}"; LogConsole(message); OnLog?.Invoke(message, logType); } public void Warn(object what) { LogType logType = LogType.Warn; string message = $"({DateFormat}) [{logType.ToString().ToUpper()}/{_className}] {what}"; LogConsole(message); OnLog?.Invoke(message, logType); } public void Error(object what) { LogType logType = LogType.Error; string message = $"({DateFormat}) [{logType.ToString().ToUpper()}/{_className}] {what}"; LogConsole(message); OnLog?.Invoke(message, logType); } private static string DateFormat => $"{DateTime.Now:t}"; private static void LogConsole(string what) => Console.WriteLine(what); private readonly string _className; } public enum LogType { Info, Warn, Error } }