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.4 KiB

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