Migrate to Serilog

This commit is contained in:
ChsBuffer
2021-05-29 19:54:44 +08:00
parent f6dfb25e3f
commit 7493f07da9
34 changed files with 162 additions and 228 deletions

View File

@@ -13,13 +13,14 @@ using System.Threading.Tasks;
using System.Windows.Forms;
using MaxMind.GeoIP2;
using Microsoft.Win32.TaskScheduler;
using Serilog;
using Task = System.Threading.Tasks.Task;
namespace Netch.Utils
{
public static class Utils
{
public static bool Open(string path)
public static void Open(string path)
{
try
{
@@ -29,12 +30,10 @@ namespace Netch.Utils
Arguments = path,
UseShellExecute = true
});
return true;
}
catch
catch (Exception e)
{
return false;
Log.Warning(e, "打开 {Uri} 失败", path);
}
}
@@ -246,7 +245,7 @@ namespace Netch.Utils
}
};
Global.Logger.Debug($"{fileName} {arguments}");
Log.Debug($"{fileName} {arguments}");
p.Start();
var output = await p.StandardOutput.ReadToEndAsync();