コード例 #1
0
        // ---------------- End of commands

        private Task Log(string msg, LogSeverity severity = LogSeverity.Info)
        {
            string source = "";

            switch (severity)
            {
            case LogSeverity.Critical:
                source = "Critical";
                break;

            case LogSeverity.Error:
                source = "Error";
                break;

            case LogSeverity.Warning:
                source = "Warning";
                break;

            case LogSeverity.Info:
                source = "Info";
                break;

            case LogSeverity.Verbose:
                source = "Verbose";
                break;

            case LogSeverity.Debug:
                source = "Debug";
                break;

            default:
                break;
            }
            LogMessage message = new LogMessage(severity, source, msg);

            Console.WriteLine(message.ToString());
            //if (AutoLog) InfoExportClass.DumpLogOutput(message.ToString());
            //BotInfo.LogList.Add(message.ToString());
            LogCatalog.AddLog(message.ToString());
            return(Task.CompletedTask);
        }
コード例 #2
0
ファイル: CombatModule.cs プロジェクト: IanWigle/DiscordBot
        // end of commands

        Task Log(string msg, LogSeverity severity = LogSeverity.Info)
        {
            string source = "";

            switch (severity)
            {
            case LogSeverity.Critical:
                source = "Critical";
                break;

            case LogSeverity.Error:
                source = "Error";
                break;

            case LogSeverity.Warning:
                source = "Warning";
                break;

            case LogSeverity.Info:
                source = "Info";
                break;

            case LogSeverity.Verbose:
                source = "Verbose";
                break;

            case LogSeverity.Debug:
                source = "Debug";
                break;

            default:
                break;
            }
            LogMessage message = new LogMessage(severity, source, msg);

            Console.WriteLine(message.ToString());
            LogCatalog.AddLog(message.ToString());
            return(Task.CompletedTask);
        }