GwWuYou 0126b69c5c refactor(source-generators): 重构源代码生成器项目结构和配置
- 移除 IArchitectureExtensible 接口定义
- 更新 Godot 源代码生成器项目配置,添加 Nullable 启用和包路径配置
- 添加 Directory.Build.props 构建属性文件到抽象层项目
- 修复命名空间引用错误和添加 using 语句
- 优化源代码生成器项目的打包配置和依赖引用
- 添加文档注释到 LogAttribute 构造函数
- 更新主项目文件中的源代码生成器相关引用路径
- 从解决方案用户设置中移除过时配置文件
- 添加解决方案用户设置到 gitignore 文件
2025-12-27 22:18:26 +08:00

38 lines
1.0 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
namespace GFramework.Godot.SourceGenerators.Abstractions.logging;
/// <summary>
/// Godot日志特性用于在类上标记以自动生成日志字段
/// </summary>
[AttributeUsage(AttributeTargets.Class, Inherited = false)]
public sealed class GodotLogAttribute : Attribute
{
/// <summary>
/// 初始化 GodotLogAttribute 类的新实例
/// </summary>
public GodotLogAttribute()
{
}
/// <summary>
/// 初始化 GodotLogAttribute 类的新实例
/// </summary>
/// <param name="name">日志分类名</param>
public GodotLogAttribute(string? name)
{
Name = name;
}
/// <summary>日志分类名(默认使用类名)</summary>
public string? Name { get; set; }
/// <summary>生成字段名</summary>
public string FieldName { get; set; } = "Logger";
/// <summary>是否生成 static 字段</summary>
public bool IsStatic { get; set; } = true;
/// <summary>访问修饰符</summary>
public string AccessModifier { get; set; } = "private";
}