mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-23 03:04:29 +08:00
- 调整注释格式统一使用4个空格缩进 - 重新排列字段声明顺序提升代码可读性 - 将简单属性访问器改为表达式主体语法 - 优化AudioManagerSystem中音量设置逻辑 - 移除AbstractAssetCatalogSystem中多余空行 - 重构日志类中方法实现为表达式主体形式 - 统一空行分隔符保持代码结构一致性 - 优化方法内部逻辑表达式简化代码 - [no tag]
39 lines
1.1 KiB
C#
39 lines
1.1 KiB
C#
#nullable enable
|
||
using System;
|
||
|
||
namespace GFramework.Godot.SourceGenerators.Attributes.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";
|
||
} |