mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 10:34:30 +08:00
- 将GFramework.SourceGenerators.Attributes重命名为GFramework.SourceGenerators.Abstractions - 将GFramework.Godot.SourceGenerators.Attributes重命名为GFramework.Godot.SourceGenerators.Abstractions - 更新所有源生成器中对Attribute命名空间的引用 - 修改项目引用从Attributes指向Abstractions - 添加程序集打包配置到生成项目 - 更新解决方案文件中的项目引用路径 - 修正测试文件中的命名空间引用
37 lines
1.1 KiB
C#
37 lines
1.1 KiB
C#
#nullable enable
|
||
namespace GFramework.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";
|
||
} |