BaseLogger.cs 512 B

1234567891011121314151617181920212223
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Text;
  6. namespace BepInEx.Logger
  7. {
  8. public abstract class BaseLogger : TextWriter
  9. {
  10. public override Encoding Encoding { get; } = new UTF8Encoding(true);
  11. public virtual void Log(LogLevel level, object entry)
  12. {
  13. WriteLine($"[{level}] {entry}");
  14. }
  15. public virtual void Log(object entry)
  16. {
  17. Log(LogLevel.Message, entry);
  18. }
  19. }
  20. }