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.

38 lines
1.4 KiB

5 years ago
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. /// <value>the level to filter to</value>
  13. public abstract Logger.LogLevel Filter { get; set; }
  14. /// <summary>
  15. /// Prints a provided message from a given log at the specified time.
  16. /// </summary>
  17. /// <param name="level">the log level</param>
  18. /// <param name="time">the time the message was composed</param>
  19. /// <param name="logName">the name of the log that created this message</param>
  20. /// <param name="message">the message</param>
  21. public abstract void Print(Logger.Level level, DateTime time, string logName, string message);
  22. /// <summary>
  23. /// Called before the first print in a group. May be called multiple times.
  24. /// Use this to create file handles and the like.
  25. /// </summary>
  26. public virtual void StartPrint() { }
  27. /// <summary>
  28. /// Called after the last print in a group. May be called multiple times.
  29. /// Use this to dispose file handles and the like.
  30. /// </summary>
  31. public virtual void EndPrint() { }
  32. internal DateTime LastUse { get; set; }
  33. }
  34. }