日志提示当前部署平台
continuous-integration/drone/push Build is passing Details

IRC_NewDev
hang 2023-11-30 11:23:27 +08:00
parent b3b3cfff57
commit a031752d33
1 changed files with 19 additions and 1 deletions

View File

@ -13,6 +13,7 @@ using System.IO;
using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Domain.Share;
using IRaCIS.Core.Infra.EFCore; using IRaCIS.Core.Infra.EFCore;
using IRaCIS.Core.Application.Helper; using IRaCIS.Core.Application.Helper;
using System.Runtime.InteropServices;
namespace IRaCIS.Core.API namespace IRaCIS.Core.API
{ {
@ -55,13 +56,30 @@ namespace IRaCIS.Core.API
//// Serilog //// Serilog
SerilogExtension.AddSerilogSetup(enviromentName, host.Services); SerilogExtension.AddSerilogSetup(enviromentName, host.Services);
Log.Logger.Warning($"µ±Ç°»·¾³£º{enviromentName}"); Log.Logger.Warning($"µ±Ç°»·¾³£º{enviromentName}");
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
Log.Logger.Warning($"当前部署平台环境windows");
}
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
Log.Logger.Warning($"当前部署平台环境linux");
}
else
{
Log.Logger.Warning($"当前部署平台环境OSX or FreeBSD");
}
NewId.SetProcessIdProvider(new CurrentProcessIdProvider()); NewId.SetProcessIdProvider(new CurrentProcessIdProvider());
host.Run(); host.Run();
} }
catch (Exception e) catch (Exception e)
{ {