优化日志数据生成

This commit is contained in:
2024-07-24 22:43:09 +08:00
parent 76e459ffcc
commit 80b1484ef0
3 changed files with 29 additions and 45 deletions

View File

@ -191,7 +191,7 @@ func (g *Gorm) write(ctx context.Context, message string, level string, data map
}
}
dataList := logger2.ZapLogDataList(logger2.NewLogData(consts.LogTypeDatabase, "", data))
dataList := logger2.ZapLogDataList(logger2.NewLogData(g.outCtx, consts.LogTypeDatabase, "", data))
switch strings.ToUpper(level) {
case consts.LogLevelDebug:
g.instance.Debug(message, dataList...)