public async Task SetLogChannel(ITextChannel channel = null) { await LogChannels.SetLogChannel(Context.Guild, channel); if (channel != null) { await Context.Channel.SendMessageAsync($"{Emojis.Success} Proxy logging channel set to #{channel.Name.Sanitize()}."); } else { await Context.Channel.SendMessageAsync($"{Emojis.Success} Proxy logging channel cleared."); } }
/// <summary> /// Log one entry to a pre-determined channel /// </summary> /// <param name="content">the content to log</param> /// <param name="channel">which log to append it to</param> /// <param name="keepItQuiet">Announce it in game or not</param> public static void Log(string content, LogChannels channel, bool keepItQuiet = false) { CommitLog(content, channel.ToString(), keepItQuiet); }
/// <summary> /// Log an exception /// </summary> /// <param name="ex">the exception</param> /// <param name="nonImportant">Should we get cross about this or not? Defaults to not.</param> public static void LogError(Exception ex, LogChannels specificLogName, bool keepItQuiet = true) { string errorContent = string.Format("{0}: {1}{2}{3}", ex.GetType().Name, ex.Message, Environment.NewLine, ex.StackTrace); CommitLog(errorContent, specificLogName.ToString(), keepItQuiet); }
/// <summary> /// Log one entry to a pre-determined channel /// </summary> /// <param name="content">the content to log</param> /// <param name="channel">which log to append it to</param> /// <param name="keepItQuiet">Announce it in game or not</param> public static void Log(string content, LogChannels channel) { CommitLog(content, channel.ToString()); }
/// <summary> /// Write to a log /// </summary> /// <param name="content">the content to log</param> /// <param name="channel">which log to append it to</param> public void WriteToLog(string content, LogChannels channel) { //Write to the log file first WriteLine(content, channel.ToString()); }