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.

37 lines
1.3 KiB

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