12345678910111213141516171819202122232425 |
- using QVCopier.Models;
- using System;
- namespace QVCopier.Utility
- {
- internal static class Logger
- {
- public static void Debug(string log) => OnLogAdded(new LogEntry { Level = LogLevel.Debug, Log = log });
- public static void Info(string log) => OnLogAdded(new LogEntry { Level = LogLevel.Info, Log = log });
- public static void Warning(string log) => OnLogAdded(new LogEntry { Level = LogLevel.Warning, Log = log });
- public static void Error(string log) => OnLogAdded(new LogEntry { Level = LogLevel.Error, Log = log });
- public static void Fatal(string log) => OnLogAdded(new LogEntry { Level = LogLevel.Fatal, Log = log });
- public static event EventHandler<LogEntry> LogAdded;
- private static void OnLogAdded(LogEntry e)
- {
- LogAdded?.Invoke(null, e);
- }
- }
- }
|