示例#1
0
 public static LogLevel ToLoggingLevel(this DSharpPlus.LogLevel level)
 {
     return(level switch
     {
         DSharpPlus.LogLevel.Debug => LogLevel.Debug,
         DSharpPlus.LogLevel.Info => LogLevel.Information,
         DSharpPlus.LogLevel.Warning => LogLevel.Warning,
         DSharpPlus.LogLevel.Error => LogLevel.Error,
         DSharpPlus.LogLevel.Critical => LogLevel.Critical,
         _ => throw new ArgumentOutOfRangeException(nameof(level))
     });
        public static NLogLevel ToNLog(this DiscordLogLevel l)
        {
            switch (l)
            {
            case DiscordLogLevel.Critical: return(NLogLevel.Fatal);

            case DiscordLogLevel.Debug: return(NLogLevel.Debug);

            case DiscordLogLevel.Error: return(NLogLevel.Error);

            case DiscordLogLevel.Info: return(NLogLevel.Info);

            case DiscordLogLevel.Warning: return(NLogLevel.Warn);

            default: return(NLogLevel.Trace);
            }
        }