移除extra逻辑

This commit is contained in:
白茶清欢 2024-07-24 22:58:05 +08:00
parent 80b1484ef0
commit f2852c8634

View File

@ -178,7 +178,7 @@ func (g *Gorm) write(ctx context.Context, message string, level string, data map
if nil == g.outCtx { if nil == g.outCtx {
g.outCtx = context.Background() g.outCtx = context.Background()
} }
for _, extraField := range g.extraCtxFieldList { /*for _, extraField := range g.extraCtxFieldList {
if len(extraField) == 0 { if len(extraField) == 0 {
continue continue
} }
@ -189,7 +189,7 @@ func (g *Gorm) write(ctx context.Context, message string, level string, data map
if val, exist := data[extraField]; !exist || nil == val { if val, exist := data[extraField]; !exist || nil == val {
data[extraField] = val data[extraField] = val
} }
} }*/
dataList := logger2.ZapLogDataList(logger2.NewLogData(g.outCtx, consts.LogTypeDatabase, "", data)) dataList := logger2.ZapLogDataList(logger2.NewLogData(g.outCtx, consts.LogTypeDatabase, "", data))
switch strings.ToUpper(level) { switch strings.ToUpper(level) {