mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 10:34:30 +08:00
- 移除 ArchitectureContext 构造函数中的 ILogger 参数 - 从 IArchitectureContext 接口中移除 Logger 属性 - 更新 AbstractContextUtility 使用 LoggerFactory 创建日志记录器 - 修改 AbstractSystem 使用 LoggerFactory 获取日志记录器 - 调整 Architecture 类中上下文创建时的日志工厂使用 - 更新 IocContainer 初始化时的日志记录器获取方式 - 移除 IIocContainer 接口中的 Init 方法定义 - [no tag]
34 lines
1.0 KiB
C#
34 lines
1.0 KiB
C#
using GFramework.Core.logging;
|
|
using GFramework.Core.rule;
|
|
|
|
namespace GFramework.Core.utility;
|
|
|
|
/// <summary>
|
|
/// 抽象上下文工具类,提供上下文相关的通用功能实现
|
|
/// 继承自ContextAwareBase并实现IContextUtility接口
|
|
/// </summary>
|
|
public abstract class AbstractContextUtility : ContextAwareBase, IContextUtility
|
|
{
|
|
protected ILogger Logger = null !;
|
|
|
|
/// <summary>
|
|
/// 初始化上下文工具类
|
|
/// </summary>
|
|
void IContextUtility.Init()
|
|
{
|
|
// 获取上下文中的日志记录器
|
|
Logger = Context.LoggerFactory.GetLogger(nameof(AbstractContextUtility));
|
|
Logger.Debug($"Initializing Context Utility: {GetType().Name}");
|
|
|
|
// 执行子类实现的初始化逻辑
|
|
OnInit();
|
|
|
|
// 记录初始化完成信息
|
|
Logger.Info($"Context Utility initialized: {GetType().Name}");
|
|
}
|
|
|
|
/// <summary>
|
|
/// 抽象初始化方法,由子类实现具体的初始化逻辑
|
|
/// </summary>
|
|
protected abstract void OnInit();
|
|
} |