日志方法增加异步与同步的方法

This commit is contained in:
2025-11-30 21:01:47 +08:00
parent fd37c5c301
commit de8fc13f18
8 changed files with 310 additions and 45 deletions

View File

@@ -153,6 +153,14 @@ func (f *Factory) getLogger() (*logger.Logger, error) {
return l, nil
}
// GetLogger 获取日志记录器对象(已初始化)
// 返回已初始化的日志记录器对象,可直接使用
// 注意:推荐使用 LogDebug、LogInfo、LogWarn、LogError 等方法直接记录日志
// 如果需要使用logger的高级功能如Close方法可以使用此方法获取logger对象
func (f *Factory) GetLogger() (*logger.Logger, error) {
return f.getLogger()
}
// LogDebug 记录调试日志
// message: 日志消息
// args: 格式化参数(可选)