示例#1
0
 public LogEventArgs(global::Discord.LogMessage message)
 {
     Message    = message.Message;
     Source     = message.Source;
     Severity   = message.Severity;
     LogMessage = LogMessage.FromDiscordLogMessage(message);
 }
示例#2
0
        public static LogMessage FromDiscordLogMessage(global::Discord.LogMessage message)
        {
            var s = new LogMessage
            {
                Message   = message.Message,
                Severity  = message.Severity,
                Exception = message.Exception
            };

            switch (message.Source)
            {
            case "Rest":
                s.Source = LogSource.Rest;
                return(s);

            case "Discord":
                s.Source = LogSource.Discord;
                return(s);

            case "Gateway":
                s.Source = LogSource.Gateway;
                return(s);

            default:
                s.Source = LogSource.Unknown;
                return(s);
            }
        }