pszczyg

DecoratorLogger_4

Jul 28th, 2021
845
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  public class NullLogger : ILogger
  2.     {
  3.         public void Exception(string message, Exception ex) { }
  4.  
  5.         public void Info(string message) { }
  6.  
  7.         public void Error(string message) { }
  8.  
  9.         public void Warning(string message) { }
  10.  
  11.         public void Progress(ProgressDataEventArgs progressData) { }
  12.     }
  13.  
  14.     public class MemoryLogger : ILogger
  15.     {
  16.         (...)//nothing changed
  17.  
  18.         public MemoryLogger(ILogger internalLogger = null) //optional change
  19.         {
  20.             Log = new List<LogLine>();
  21.             _internalLogger = internalLogger ?? new NullLogger(); //optional change
  22.         }
  23.  
  24.         (...)//nothing changed
  25.    }
RAW Paste Data