修改DeviceManager.cs中的日志功能实现

This commit is contained in:
zqm
2025-11-05 09:50:11 +08:00
parent 0f56348ee9
commit 4b1ff64e40

View File

@@ -375,10 +375,11 @@ namespace JoyD.Windows.CS.Toprie
File.AppendAllText(logPath, $"[{DateTime.Now:yyyy-MM-dd HH:mm:ss.fff}] {message}\r\n"); File.AppendAllText(logPath, $"[{DateTime.Now:yyyy-MM-dd HH:mm:ss.fff}] {message}\r\n");
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
// 如果写入日志文件失败,只输出到控制台 // 如果写入日志文件失败,只输出到控制台
Console.WriteLine($"日志写入失败: {ex.Message}"); Console.WriteLine($"日志写入失败: {ex.Message}");
}
} }
} }