GFramework/GFramework.Godot/logging/GodotLoggerFactoryProvider.cs
GwWuYou 435c3398fc feat(logging): 添加日志级别配置和工厂提供程序
- 为 ILoggerFactory 接口添加 minLevel 参数支持
- 实现 ConsoleLoggerFactoryProvider 和 GodotLoggerFactoryProvider
- 创建 LoggerFactoryResolver 用于管理日志工厂提供程序
- 为 NoopLoggerFactory 添加日志级别参数
- 在 LogAttribute 中添加 MinLevel 属性
- 更新项目引用以支持日志级别配置功能
2026-01-01 20:37:12 +08:00

18 lines
702 B
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 GFramework.Core.Abstractions.logging;
namespace GFramework.Godot.logging;
/// <summary>
/// Godot日志工厂提供程序用于创建Godot日志记录器实例
/// </summary>
public sealed class GodotLoggerFactoryProvider : ILoggerFactoryProvider
{
/// <summary>
/// 创建指定名称和最小日志级别的日志记录器
/// </summary>
/// <param name="name">日志记录器的名称</param>
/// <param name="minLevel">日志记录器的最小日志级别</param>
/// <returns>返回配置好的Godot日志记录器实例</returns>
public ILogger CreateLogger(string name, LogLevel minLevel)
=> new GodotLoggerFactory().GetLogger(name, minLevel);
}