From 0966baa1d8fa981bbbf5ba4e8f56bf138f6153c1 Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 13 Oct 2023 11:21:45 +0800 Subject: [PATCH] rename: rename Models.Issue to Models.CrashInfo --- src/App.xaml.cs | 4 ++-- src/Models/{Issue.cs => CrashInfo.cs} | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) rename src/Models/{Issue.cs => CrashInfo.cs} (83%) diff --git a/src/App.xaml.cs b/src/App.xaml.cs index 845bef46..16637cd1 100644 --- a/src/App.xaml.cs +++ b/src/App.xaml.cs @@ -39,8 +39,8 @@ namespace SourceGit { protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); - // 崩溃上报 - AppDomain.CurrentDomain.UnhandledException += (_, ev) => Models.Issue.Create(ev.ExceptionObject as Exception); + // 崩溃文件生成 + AppDomain.CurrentDomain.UnhandledException += (_, ev) => Models.CrashInfo.Create(ev.ExceptionObject as Exception); // 创建必要目录 if (!Directory.Exists(Views.Controls.Avatar.CACHE_PATH)) { diff --git a/src/Models/Issue.cs b/src/Models/CrashInfo.cs similarity index 83% rename from src/Models/Issue.cs rename to src/Models/CrashInfo.cs index 52e531d6..02318bac 100644 --- a/src/Models/Issue.cs +++ b/src/Models/CrashInfo.cs @@ -8,17 +8,17 @@ namespace SourceGit.Models { /// /// 崩溃日志生成 /// - public class Issue { - public static void Create(System.Exception e) { + public class CrashInfo { + public static void Create(Exception e) { var builder = new StringBuilder(); builder.Append("Crash: "); builder.Append(e.Message); builder.Append("\n\n"); builder.Append("----------------------------\n"); builder.Append($"Windows OS: {Environment.OSVersion}\n"); - builder.Append($"Version: {Assembly.GetExecutingAssembly().GetName().Version}"); - builder.Append($"Platform: {AppDomain.CurrentDomain.SetupInformation.TargetFrameworkName}"); - builder.Append($"Source: {e.Source}"); + builder.Append($"Version: {Assembly.GetExecutingAssembly().GetName().Version}\n"); + builder.Append($"Platform: {AppDomain.CurrentDomain.SetupInformation.TargetFrameworkName}\n"); + builder.Append($"Source: {e.Source}\n"); builder.Append($"---------------------------\n\n"); builder.Append(e.StackTrace);