You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.4 KiB

  1. #nullable enable
  2. using System;
  3. namespace IPA.Logging
  4. {
  5. /// <summary>
  6. /// The log printer's base class.
  7. /// </summary>
  8. public abstract class LogPrinter
  9. {
  10. /// <summary>
  11. /// Provides a filter for which log levels to allow through.
  12. /// </summary>
  13. /// <value>the level to filter to</value>
  14. public abstract Logger.LogLevel Filter { get; set; }
  15. /// <summary>
  16. /// Prints a provided message from a given log at the specified time.
  17. /// </summary>
  18. /// <param name="level">the log level</param>
  19. /// <param name="time">the time the message was composed</param>
  20. /// <param name="logName">the name of the log that created this message</param>
  21. /// <param name="message">the message</param>
  22. public abstract void Print(Logger.Level level, DateTime time, string logName, string message);
  23. /// <summary>
  24. /// Called before the first print in a group. May be called multiple times.
  25. /// Use this to create file handles and the like.
  26. /// </summary>
  27. public virtual void StartPrint() { }
  28. /// <summary>
  29. /// Called after the last print in a group. May be called multiple times.
  30. /// Use this to dispose file handles and the like.
  31. /// </summary>
  32. public virtual void EndPrint() { }
  33. internal DateTime LastUse { get; set; }
  34. }
  35. }