过滤空的字段
This commit is contained in:
1 parent
532ea798c3
commit
43ebfc11aa
3 files changed
+8
-74
No files matched your search
@@ -167,6 +167,9 @@ func (g *Gorm) write(dataList []zap.Field, level string) {
|
||||
}
|
||||
if nil != g.ctx {
|
||||
for _, extraField := range g.extraCtxFieldList {
|
||||
if len(extraField) == 0 {
|
||||
continue
|
||||
}
|
||||
dataList = append(dataList, zap.Any(extraField, g.ctx.Value(extraField)))
|
||||
}
|
||||
}
|
||||
|
||||