From da3a50e20ce31227353ce51f76572a1bf550e9a4 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 19 Feb 2024 15:41:13 +0800 Subject: [PATCH] update: store crash log in $APPDATA --- src/App.axaml.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/App.axaml.cs b/src/App.axaml.cs index 924d79b5..f11f9eaf 100644 --- a/src/App.axaml.cs +++ b/src/App.axaml.cs @@ -32,8 +32,9 @@ namespace SourceGit { builder.Append(ex.StackTrace); var time = DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss"); - var file = Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName); - file = Path.Combine(file, $"crash_{time}.log"); + var file = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), + "SourceGit", + $"crash_{time}.log"); File.WriteAllText(file, builder.ToString()); } }