private static void Report(Exception e, [CallerMemberName] string method = "") { var logger = LogManager.GetLogger(method); logger.Fatal(ExceptionFormatter.ExceptionWithRuntimeInfo(e)); var reportWindow = new ReportWindow(e); reportWindow.Show(); }
private void SetException(Exception exception) { string path = Log.CurrentLogDirectory; var directory = new DirectoryInfo(path); var log = directory.GetFiles().OrderByDescending(f => f.LastWriteTime).First(); var paragraph = Hyperlink("Please open new issue in: ", Constant.Issue); paragraph.Inlines.Add($"1. upload log file: {log.FullName}\n"); paragraph.Inlines.Add($"2. copy below exception message"); ErrorTextbox.Document.Blocks.Add(paragraph); var content = ExceptionFormatter.ExceptionWithRuntimeInfo(exception); paragraph = new Paragraph(); paragraph.Inlines.Add(content); ErrorTextbox.Document.Blocks.Add(paragraph); }
private void SetException(Exception exception, string id) { var path = Log.CurrentLogDirectory; var directory = new DirectoryInfo(path); var log = directory.GetFiles().OrderByDescending(f => f.LastWriteTime).First(); Paragraph paragraph; var websiteKey = nameof(PluginPair.Metadata.Website); if (exception.Data.Contains(websiteKey)) { paragraph = Hyperlink("You can help plugin author to fix this issue by opening issue in: ", exception.Data[websiteKey].ToString()); var nameKey = nameof(PluginPair.Metadata.Name); if (exception.Data.Contains(nameKey)) { paragraph.Inlines.Add($"Plugin Name {exception.Data[nameKey]}"); } var pluginDirectoryKey = nameof(PluginPair.Metadata.PluginDirectory); if (exception.Data.Contains(pluginDirectoryKey)) { paragraph.Inlines.Add($"Plugin Directory {exception.Data[pluginDirectoryKey]}"); } var idKey = nameof(PluginPair.Metadata.ID); if (exception.Data.Contains(idKey)) { paragraph.Inlines.Add($"Plugin ID {exception.Data[idKey]}"); } } else { paragraph = Hyperlink("You can help us to fix this issue by opening issue in: ", Constant.Issue); } paragraph.Inlines.Add($"1. upload log file: {log.FullName}\n"); paragraph.Inlines.Add("2. copy below exception message"); ErrorTextBox.Document.Blocks.Add(paragraph); var content = ExceptionFormatter.ExceptionWithRuntimeInfo(exception, id); paragraph = new Paragraph(); paragraph.Inlines.Add(content); ErrorTextBox.Document.Blocks.Add(paragraph); }