Пример #1
0
 /// <summary>
 /// 记录调试信息到日志。
 /// </summary>
 /// <param name="message">要记录的信息。</param>
 /// <param name="exception">异常对象。</param>
 public void Debug(object message, Exception exception = null)
 {
     if (LogEnvironment.IsConfigured(LogLevel.Debug))
     {
         log.Debug(exception, message?.ToString());
     }
 }
Пример #2
0
 /// <summary>
 /// 记录致命信息到日志。
 /// </summary>
 /// <param name="message">要记录的信息。</param>
 /// <param name="exception">异常对象。</param>
 public void Fatal(object message, Exception exception = null)
 {
     if (LogEnvironment.IsConfigured(LogLevel.Fatal))
     {
         log.Fatal(exception, message?.ToString());
     }
 }
Пример #3
0
 /// <summary>
 /// 记录警告信息到日志。
 /// </summary>
 /// <param name="message">要记录的信息。</param>
 /// <param name="exception">异常对象。</param>
 public void Warn(object message, Exception exception = null)
 {
     if (LogEnvironment.IsConfigured(LogLevel.Warn))
     {
         _logger.Warn(exception, message?.ToString());
     }
 }
Пример #4
0
 /// <summary>
 /// 记录错误信息到日志。
 /// </summary>
 /// <param name="message">要记录的信息。</param>
 /// <param name="exception">异常对象。</param>
 public void Error(object message, Exception exception = null)
 {
     if (LogEnvironment.IsConfigured(LogLevel.Error))
     {
         log.Error(exception, message?.ToString());
     }
 }
Пример #5
0
 /// <summary>
 /// 记录致命信息到日志。
 /// </summary>
 /// <param name="message">要记录的信息。</param>
 /// <param name="exception">异常对象。</param>
 public void Fatal(object message, Exception exception = null)
 {
     if (LogEnvironment.IsConfigured(LogLevel.Fatal))
     {
         log.Fatal(message, exception);
     }
 }
Пример #6
0
 /// <summary>
 /// 异步的,记录致命信息到日志。
 /// </summary>
 /// <param name="message">要记录的信息。</param>
 /// <param name="exception">异常对象。</param>
 public async Task FatalAsync(object message, Exception exception = null, CancellationToken cancellationToken = default)
 {
     if (LogEnvironment.IsConfigured(LogLevel.Fatal))
     {
         _logger.Fatal(exception, message?.ToString());
     }
 }
Пример #7
0
 /// <summary>
 /// 记录警告信息到日志。
 /// </summary>
 /// <param name="message">要记录的信息。</param>
 /// <param name="exception">异常对象。</param>
 public void Warn(object message, Exception exception = null)
 {
     if (LogEnvironment.IsConfigured(LogLevel.Warn))
     {
         log.Warn(message, exception);
     }
 }
Пример #8
0
 /// <summary>
 /// 记录调试信息到日志。
 /// </summary>
 /// <param name="message">要记录的信息。</param>
 /// <param name="exception">异常对象。</param>
 public void Debug(object message, Exception exception = null)
 {
     if (LogEnvironment.IsConfigured(LogLevel.Debug))
     {
         log.Debug(message, exception);
     }
 }
Пример #9
0
 /// <summary>
 /// 记录一般的信息到日志。
 /// </summary>
 /// <param name="message">要记录的信息。</param>
 /// <param name="exception">异常对象。</param>
 public void Info(object message, Exception exception = null)
 {
     if (LogEnvironment.IsConfigured(LogLevel.Info))
     {
         log.Info(message, exception);
     }
 }
Пример #10
0
 /// <summary>
 /// 记录错误信息到日志。
 /// </summary>
 /// <param name="message">要记录的信息。</param>
 /// <param name="exception">异常对象。</param>
 public void Error(object message, Exception exception = null)
 {
     if (LogEnvironment.IsConfigured(LogLevel.Error))
     {
         log.Error(message, exception);
     }
 }
Пример #11
0
 /// <summary>
 /// 异步的,记录致命信息到日志。
 /// </summary>
 /// <param name="message">要记录的信息。</param>
 /// <param name="exception">异常对象。</param>
 public async Task FatalAsync(object message, Exception exception = null, CancellationToken cancellationToken = default)
 {
     if (LogEnvironment.IsConfigured(LogLevel.Fatal))
     {
         log.Fatal(message, exception);
     }
 }
Пример #12
0
 /// <summary>
 /// 异步的,记录错误信息到日志。
 /// </summary>
 /// <param name="message">要记录的信息。</param>
 /// <param name="exception">异常对象。</param>
 public async Task ErrorAsync(object message, Exception exception = null, CancellationToken cancellationToken = default)
 {
     if (LogEnvironment.IsConfigured(LogLevel.Error))
     {
         log.Error(exception, message?.ToString());
     }
 }
Пример #13
0
 /// <summary>
 /// 异步的,记录调试信息到日志。
 /// </summary>
 /// <param name="message">要记录的信息。</param>
 /// <param name="exception">异常对象。</param>
 public async Task DebugAsync(object message, Exception exception = null, CancellationToken cancellationToken = default)
 {
     if (LogEnvironment.IsConfigured(LogLevel.Debug))
     {
         _logger.Debug(message, exception);
     }
 }