diff --git a/src/Luban.Common/Source/Utils/LogUtil.cs b/src/Luban.Common/Source/Utils/LogUtil.cs index 13420b1..0464fd8 100644 --- a/src/Luban.Common/Source/Utils/LogUtil.cs +++ b/src/Luban.Common/Source/Utils/LogUtil.cs @@ -15,6 +15,7 @@ namespace Luban.Common.Utils layout = NLog.Layouts.Layout.FromString("${longdate}|${message}${onexception:${newline}${exception:format=tostring}${exception:format=StackTrace}}"); } logConfig.AddTarget("console", new NLog.Targets.ColoredConsoleTarget() { Layout = layout }); + logConfig.AddRule(minConsoleLogLevel, NLog.LogLevel.Off, new NLog.Targets.NullTarget(), "Bright.Net.Channels.*", true); logConfig.AddRule(minConsoleLogLevel, NLog.LogLevel.Fatal, "console"); NLog.LogManager.Configuration = logConfig; } diff --git a/src/Luban.Job.Common/Source/Defs/DefAssemblyBase.cs b/src/Luban.Job.Common/Source/Defs/DefAssemblyBase.cs index f3adf55..82886b5 100644 --- a/src/Luban.Job.Common/Source/Defs/DefAssemblyBase.cs +++ b/src/Luban.Job.Common/Source/Defs/DefAssemblyBase.cs @@ -34,6 +34,8 @@ namespace Luban.Job.Common.Defs public Dictionary Types { get; } = new Dictionary(); + private readonly Dictionary _notCaseSenceTypes = new (); + public IAgent Agent { get; protected set; } public string TopModule { get; protected set; } @@ -175,6 +177,11 @@ namespace Luban.Job.Common.Defs { throw new Exception($"type:'{fullName}' duplicate"); } + + if (!_notCaseSenceTypes.TryAdd(fullName.ToLower(), type)) + { + throw new Exception($"type:'{fullName}' 和 type:'{_notCaseSenceTypes[fullName.ToLower()].FullName}' 类名小写重复. 在win平台有问题"); + } Types.Add(fullName, type); }