#nullable enable
using System;
namespace GFramework.Generator.Attributes.generator.logging;
///
/// 标注在类上,Source Generator 会为该类自动生成一个日志记录器字段。
///
[AttributeUsage(AttributeTargets.Class, Inherited = false)]
public sealed class LogAttribute : Attribute
{
/// 日志分类名(默认使用类名)
public string? Category { get; }
/// 生成字段名
public string FieldName { get; set; } = "_log";
/// 是否生成 static 字段
public bool IsStatic { get; set; } = true;
/// 访问修饰符
public string AccessModifier { get; set; } = "private";
///
/// 初始化 LogAttribute 类的新实例
///
/// 日志分类名,默认使用类名
public LogAttribute(string? category = null)
{
Category = category;
}
}