mirror of
https://gitee.com/ThingsGateway/ThingsGateway.git
synced 2025-10-23 03:50:30 +08:00
去除不必要的控制台日志输出
This commit is contained in:
@@ -29,7 +29,6 @@ using ThingsGateway.Admin.Application;
|
||||
using ThingsGateway.Admin.Razor;
|
||||
using ThingsGateway.Extension;
|
||||
using ThingsGateway.NewLife.Caching;
|
||||
using ThingsGateway.NewLife.Extension;
|
||||
|
||||
namespace ThingsGateway.AdminServer;
|
||||
|
||||
@@ -161,7 +160,8 @@ public class Startup : AppStartup
|
||||
{
|
||||
options.WriteFilter = (logMsg) =>
|
||||
{
|
||||
if (logMsg.Message.IsNullOrEmpty()) return false;
|
||||
if (App.HostApplicationLifetime.ApplicationStopping.IsCancellationRequested && logMsg.LogLevel >= LogLevel.Warning) return false;
|
||||
if (string.IsNullOrEmpty(logMsg.Message)) return false;
|
||||
else return true;
|
||||
};
|
||||
|
||||
|
@@ -71,13 +71,25 @@ public static class App
|
||||
/// </summary>
|
||||
public static IServiceProvider RootServices => InternalApp.RootServices;
|
||||
|
||||
private static IHostApplicationLifetime hostApplicationLifetime;
|
||||
public static IHostApplicationLifetime HostApplicationLifetime
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((hostApplicationLifetime == null))
|
||||
{
|
||||
hostApplicationLifetime = RootServices?.GetService<IHostApplicationLifetime>();
|
||||
}
|
||||
return hostApplicationLifetime;
|
||||
}
|
||||
}
|
||||
|
||||
private static IStringLocalizerFactory? stringLocalizerFactory;
|
||||
|
||||
/// <summary>
|
||||
/// 本地化服务工厂
|
||||
/// </summary>
|
||||
public static IStringLocalizerFactory? StringLocalizerFactory
|
||||
|
||||
{
|
||||
get
|
||||
{
|
||||
|
@@ -1,8 +1,8 @@
|
||||
<Project>
|
||||
|
||||
<PropertyGroup>
|
||||
<PluginVersion>10.6.30</PluginVersion>
|
||||
<ProPluginVersion>10.6.30</ProPluginVersion>
|
||||
<PluginVersion>10.6.31</PluginVersion>
|
||||
<ProPluginVersion>10.6.31</ProPluginVersion>
|
||||
<AuthenticationVersion>2.1.8</AuthenticationVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
|
@@ -63,11 +63,8 @@ public partial class Synchronization : BusinessBase, IRpcDriver
|
||||
|
||||
protected override async ValueTask ProtectedExecuteAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
|
||||
if (_driverPropertys.IsServer)
|
||||
{
|
||||
if (_tcpDmtpService.ServerState != ServerState.Running)
|
||||
@@ -309,11 +306,11 @@ public partial class Synchronization : BusinessBase, IRpcDriver
|
||||
a.Channel.Id = CommonUtils.GetSingleId();
|
||||
a.DeviceVariables.ForEach(b =>
|
||||
{
|
||||
b.Device.ChannelId=a.Channel.Id;
|
||||
b.Device.ChannelId = a.Channel.Id;
|
||||
b.Device.Id = CommonUtils.GetSingleId();
|
||||
b.Variables.ForEach(c =>
|
||||
{
|
||||
c.DeviceId= b.Device.Id;
|
||||
c.DeviceId = b.Device.Id;
|
||||
c.Id = 0;
|
||||
});
|
||||
});
|
||||
|
@@ -37,7 +37,6 @@ using ThingsGateway.Debug;
|
||||
using ThingsGateway.Extension;
|
||||
using ThingsGateway.Gateway.Application;
|
||||
using ThingsGateway.NewLife.Caching;
|
||||
using ThingsGateway.NewLife.Extension;
|
||||
|
||||
namespace ThingsGateway.Server;
|
||||
|
||||
@@ -138,7 +137,8 @@ public class Startup : AppStartup
|
||||
{
|
||||
options.WriteFilter = (logMsg) =>
|
||||
{
|
||||
if (logMsg.Message.IsNullOrEmpty()) return false;
|
||||
if (App.HostApplicationLifetime.ApplicationStopping.IsCancellationRequested && logMsg.LogLevel >= LogLevel.Warning) return false;
|
||||
if (string.IsNullOrEmpty(logMsg.Message)) return false;
|
||||
else return true;
|
||||
};
|
||||
|
||||
|
@@ -29,7 +29,6 @@ using ThingsGateway.Admin.Application;
|
||||
using ThingsGateway.Admin.Razor;
|
||||
using ThingsGateway.Extension;
|
||||
using ThingsGateway.NewLife.Caching;
|
||||
using ThingsGateway.NewLife.Extension;
|
||||
|
||||
namespace ThingsGateway.Server;
|
||||
|
||||
@@ -162,7 +161,8 @@ public class Startup : AppStartup
|
||||
{
|
||||
options.WriteFilter = (logMsg) =>
|
||||
{
|
||||
if (logMsg.Message.IsNullOrEmpty()) return false;
|
||||
if (App.HostApplicationLifetime.ApplicationStopping.IsCancellationRequested && logMsg.LogLevel >= LogLevel.Warning) return false;
|
||||
if (string.IsNullOrEmpty(logMsg.Message)) return false;
|
||||
else return true;
|
||||
};
|
||||
|
||||
|
@@ -157,6 +157,7 @@ public class Startup : AppStartup
|
||||
{
|
||||
options.WriteFilter = (logMsg) =>
|
||||
{
|
||||
if (App.HostApplicationLifetime.ApplicationStopping.IsCancellationRequested && logMsg.LogLevel >= LogLevel.Warning) return false;
|
||||
if (string.IsNullOrEmpty(logMsg.Message)) return false;
|
||||
else return true;
|
||||
};
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<Version>10.6.30</Version>
|
||||
<Version>10.6.31</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
Reference in New Issue
Block a user