refactor(logging): 统一使用自定义Loger替代g.Log()日志记录

This commit is contained in:
1
2025-07-26 03:48:06 +00:00
parent dcc5ef047c
commit 5d2b48ccc0
26 changed files with 72 additions and 73 deletions

View File

@@ -28,7 +28,7 @@ func init() {
ctx = gctx.GetInitCtx()
redisConfig = &gredis.Config{}
)
g.Log().Debug(ctx, "module cool init start ...")
Loger.Debug(ctx, "module cool init start ...")
buildData := gbuild.Data()
if _, ok := buildData["mode"]; ok {
RunMode = buildData["mode"].(string)
@@ -38,7 +38,7 @@ func init() {
}
redisVar, err := g.Cfg().Get(ctx, "redis.cool")
if err != nil {
g.Log().Error(ctx, "初始化缓存失败,请检查配置文件")
Loger.Error(ctx, "初始化缓存失败,请检查配置文件")
panic(err)
}
if !redisVar.IsEmpty() {
@@ -50,10 +50,10 @@ func init() {
CacheManager.SetAdapter(gcache.NewAdapterRedis(redis))
IsRedisMode = true
}
//g.Log().Debug(ctx, "当前运行模式", RunMode)
g.Log().Debug(ctx, "当前实例ID:", ProcessFlag)
g.Log().Debug(ctx, "是否缓存模式:", IsRedisMode)
g.Log().Debug(ctx, "module cool init finished ...")
//Logerebug(ctx, "当前运行模式", RunMode)
Loger.Debug(ctx, "当前实例ID:", ProcessFlag)
Loger.Debug(ctx, "是否缓存模式:", IsRedisMode)
Loger.Debug(ctx, "module cool init finished ...")
}