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

19 lines
615 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 class GodotLoggerFactory : ILoggerFactory
{
/// <summary>
/// 获取指定名称的日志记录器实例
/// </summary>
/// <param name="name">日志记录器的名称</param>
/// <returns>返回GodotLogger类型的日志记录器实例</returns>
public ILogger GetLogger(string name, LogLevel minLevel = LogLevel.Info)
{
return new GodotLogger(name, minLevel);
}
}