示例#1
0
        private static NLog.LogLevel GetLevel(LogLevel level)
        {
            switch (level)
            {
            case LogLevel.Trace:
                return(NLog.LogLevel.Trace);

            case LogLevel.Debug:
                return(NLog.LogLevel.Debug);

            case LogLevel.Info:
                return(NLog.LogLevel.Info);

            case LogLevel.Warn:
                return(NLog.LogLevel.Warn);

            case LogLevel.Error:
                return(NLog.LogLevel.Error);

            case LogLevel.Fatal:
                return(NLog.LogLevel.Fatal);

            case LogLevel.Off:
                return(NLog.LogLevel.Off);

            default:
                return(NLog.LogLevel.Off);
            }
        }
示例#2
0
 private static NLog.LogLevel GetLevel(LogLevel level)
 {
     switch (level)
     {
         case LogLevel.Trace:
             return NLog.LogLevel.Trace;
         case LogLevel.Debug:
             return NLog.LogLevel.Debug;
         case LogLevel.Info:
             return NLog.LogLevel.Info;
         case LogLevel.Warn:
             return NLog.LogLevel.Warn;
         case LogLevel.Error:
             return NLog.LogLevel.Error;
         case LogLevel.Fatal:
             return NLog.LogLevel.Fatal;
         case LogLevel.Off:
             return NLog.LogLevel.Off;
         default:
             return NLog.LogLevel.Off;
     }
 }
示例#3
0
 /// <summary>
 /// 获取日志输出处理委托实例
 /// </summary>
 /// <param name="level">日志输出级别</param>
 /// <param name="message">日志消息</param>
 /// <param name="exception">日志异常</param>
 protected override void WriteInternal(LogLevel level, object message, Exception exception)
 {
     _logger.Log(GetLevel(level), message.ToString(), exception);
 }
示例#4
0
 /// <summary>
 /// 获取日志输出处理委托实例
 /// </summary>
 /// <param name="level">日志输出级别</param>
 /// <param name="message">日志消息</param>
 /// <param name="exception">日志异常</param>
 protected override void WriteInternal(LogLevel level, object message, Exception exception)
 {
     _logger.Log(GetLevel(level), message.ToString(), exception);
 }