Beispiel #1
0
 public void Log(MT.LogLevel level, MT.LogOutputProvider messageProvider)
 {
     if (level == MT.LogLevel.Fatal)
     {
         Fatal(messageProvider);
     }
     else if (level == MT.LogLevel.Error)
     {
         Error(messageProvider);
     }
     else if (level == MT.LogLevel.Warn)
     {
         Warn(messageProvider);
     }
     else if (level == MT.LogLevel.Info)
     {
         Info(messageProvider);
     }
     else if (level >= MT.LogLevel.Debug)
     {
         Debug(messageProvider);
     }
 }
Beispiel #2
0
 public void Error(MT.LogOutputProvider messageProvider)
 {
     _logger.Log(LogLevel.Error, 0, messageProvider, null, MessageFormatter);
 }
Beispiel #3
0
 public void Debug(MT.LogOutputProvider messageProvider)
 {
     _logger.Log(LogLevel.Debug, 0, messageProvider, null, MessageFormatter);
 }
Beispiel #4
0
 private static string MessageFormatter(MT.LogOutputProvider output, Exception error)
 {
     return(output == null ? null : output()?.ToString());
 }
Beispiel #5
0
 public void Warn(MT.LogOutputProvider messageProvider)
 {
     _logger.Log(LogLevel.Warning, 0, messageProvider, null, MessageFormatter);
 }
Beispiel #6
0
 public void Info(MT.LogOutputProvider messageProvider)
 {
     _logger.Log(LogLevel.Information, 0, messageProvider, null, MessageFormatter);
 }
Beispiel #7
0
 public void Fatal(MT.LogOutputProvider messageProvider)
 {
     _logger.Log(LogLevel.Critical, 0, messageProvider, null, MessageFormatter);
 }