mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 18:52:08 +08:00
- 将日志工厂配置改为日志属性配置,使用LoggerProperties替代ILoggerFactory - 引入ArchitectureProperties替代ArchitectureOptions,统一架构配置属性 - 修改日志记录器创建方式,使用LoggerFactoryResolver.Provider统一管理 - 重构控制台日志工厂提供程序接口,移除minLevel参数 - 更新架构配置接口和上下文接口中的日志相关属性 - 移除Godot日志生成器相关的源代码生成器和特性 - 更新源代码生成器中的日志创建逻辑,使用新的日志工厂解析器
40 lines
1.1 KiB
C#
40 lines
1.1 KiB
C#
#nullable enable
|
||
using System;
|
||
|
||
namespace GFramework.SourceGenerators.Abstractions.logging;
|
||
|
||
/// <summary>
|
||
/// 标注在类上,Source Generator 会为该类自动生成一个日志记录器字段。
|
||
/// </summary>
|
||
[AttributeUsage(AttributeTargets.Class, Inherited = false)]
|
||
public sealed class LogAttribute : Attribute
|
||
{
|
||
/// <summary>
|
||
/// 初始化 LogAttribute 类的新实例
|
||
/// </summary>
|
||
public LogAttribute()
|
||
{
|
||
}
|
||
|
||
/// <summary>
|
||
/// 初始化 GodotLogAttribute 类的新实例
|
||
/// </summary>
|
||
/// <param name="name">日志分类名,默认使用类名</param>
|
||
public LogAttribute(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";
|
||
} |