diff --git a/GFramework.Godot.SourceGenerators/logging/GodotLoggerGenerator.cs b/GFramework.Godot.SourceGenerators/logging/GodotLoggerGenerator.cs index 35f4c10..b4b5cab 100644 --- a/GFramework.Godot.SourceGenerators/logging/GodotLoggerGenerator.cs +++ b/GFramework.Godot.SourceGenerators/logging/GodotLoggerGenerator.cs @@ -14,9 +14,11 @@ namespace GFramework.Godot.SourceGenerators.logging; [Generator] public sealed class GodotLoggerGenerator : IIncrementalGenerator { - private const string AttributeMetadataName = "GFramework.SourceGenerators.Attributes.logging.GodotLogAttribute"; + private const string AttributeMetadataName = + "GFramework.Godot.SourceGenerators.Attributes.logging.GodotLogAttribute"; + private const string AttributeShortName = "GodotLogAttribute"; - private const string AttributeShortNameWithoutSuffix = "Log"; + private const string AttributeShortNameWithoutSuffix = "GodotLog"; /// /// 初始化生成器,设置语法过滤和代码生成逻辑 diff --git a/GFramework.SourceGenerators/logging/LoggerGenerator.cs b/GFramework.SourceGenerators/logging/LoggerGenerator.cs index d71f4c3..20a0bcd 100644 --- a/GFramework.SourceGenerators/logging/LoggerGenerator.cs +++ b/GFramework.SourceGenerators/logging/LoggerGenerator.cs @@ -17,8 +17,8 @@ namespace GFramework.SourceGenerators.logging; [Generator] public sealed class LoggerGenerator : IIncrementalGenerator { - private const string AttributeMetadataName = "GFramework.SourceGenerators.Attributes.logging.GodotLogAttribute"; - private const string AttributeShortName = "GodotLogAttribute"; + private const string AttributeMetadataName = "GFramework.SourceGenerators.Attributes.logging.LogAttribute"; + private const string AttributeShortName = "LogAttribute"; private const string AttributeShortNameWithoutSuffix = "Log"; /// @@ -163,7 +163,7 @@ public sealed class LoggerGenerator : IIncrementalGenerator sb.AppendLine($" /// Auto-generated logger"); sb.AppendLine( $" {access} {staticKeyword}readonly ILogger {fieldName} = " + - $"new ConsoleLoggerFactory.GetLogger(\"{name}\");"); + $"new ConsoleLoggerFactory().GetLogger(\"{name}\");"); sb.AppendLine(" }"); if (ns is not null)