remove debug/trace logging and clean up log files
This commit is contained in:
@@ -531,33 +531,11 @@ internal sealed partial class MainForm : Form
|
|||||||
|
|
||||||
// ─── Shutdown ──────────────────────────────────────────────────────────
|
// ─── Shutdown ──────────────────────────────────────────────────────────
|
||||||
|
|
||||||
private static string DisposeLogPath => Path.Combine(AppConfig.AppDataDir, "dispose.log");
|
|
||||||
|
|
||||||
private static void LogDispose(string label, long elapsedMs)
|
|
||||||
{
|
|
||||||
string line = $"[{DateTime.Now:HH:mm:ss.fff}] {label}: {elapsedMs}ms";
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Directory.CreateDirectory(AppConfig.AppDataDir);
|
|
||||||
File.AppendAllText(DisposeLogPath, line + "\n");
|
|
||||||
}
|
|
||||||
catch { }
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnFormClosing(object? sender, FormClosingEventArgs e)
|
private void OnFormClosing(object? sender, FormClosingEventArgs e)
|
||||||
{
|
{
|
||||||
var sw = Stopwatch.StartNew();
|
|
||||||
_pttHotkey?.Dispose();
|
_pttHotkey?.Dispose();
|
||||||
LogDispose("pttHotkey.Dispose", sw.ElapsedMilliseconds);
|
|
||||||
|
|
||||||
_trayIcon!.Visible = false;
|
_trayIcon!.Visible = false;
|
||||||
|
|
||||||
sw.Restart();
|
|
||||||
ReleaseModel();
|
ReleaseModel();
|
||||||
LogDispose("ReleaseModel", sw.ElapsedMilliseconds);
|
|
||||||
|
|
||||||
sw.Restart();
|
|
||||||
SaveConfig();
|
SaveConfig();
|
||||||
LogDispose("SaveConfig", sw.ElapsedMilliseconds);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user