防止日志打印失败造成的程序闪退

This commit is contained in:
nilaoda 2023-09-19 22:56:56 +08:00
parent 836a90800b
commit e0ba6acd60
1 changed files with 28 additions and 21 deletions

View File

@ -69,6 +69,8 @@ namespace N_m3u8DL_RE.Common.Log
}
private static void HandleLog(string write, string subWrite = "")
{
try
{
if (subWrite == "")
{
@ -98,6 +100,11 @@ namespace N_m3u8DL_RE.Common.Log
}
}
}
catch (Exception)
{
Console.WriteLine("Failed to write: " + write);
}
}
private static string ReplaceVars(string data, params object[] ps)
{