update<crash>: store crash log in $APPDATA

This commit is contained in:
leo 2024-02-19 15:41:13 +08:00
parent 01af736d50
commit da3a50e20c

View file

@ -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());
}
}