Log.cs 616 B

1234567891011121314151617181920212223242526
  1. namespace InABox.Core
  2. {
  3. public enum LogType
  4. {
  5. Information,
  6. Query,
  7. Update,
  8. Error,
  9. /// <summary>
  10. /// This log is an important notice that the system administrator should not ignore.
  11. /// </summary>
  12. Important
  13. }
  14. public delegate void LogFunction(LogType type, string userid, string message);
  15. public static class Logger
  16. {
  17. public static event LogFunction OnLog;
  18. public static void Send(LogType logtype, string userid, string message)
  19. {
  20. OnLog?.Invoke(logtype, userid, message);
  21. }
  22. }
  23. }