From c3f5c51411346a02c5ce41c8a514d88d0c6aec12 Mon Sep 17 00:00:00 2001 From: Aoang Date: Sat, 4 Dec 2021 10:47:39 +0800 Subject: [PATCH] update Gorm log import --- gorm.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gorm.go b/gorm.go index cf9e6cd..f53e795 100644 --- a/gorm.go +++ b/gorm.go @@ -22,9 +22,9 @@ type GormLogger struct { IgnoreRecordNotFoundError bool } -func NewGormLogger() *GormLogger { +func Gorm(l *zap.Logger) *GormLogger { return &GormLogger{ - log: With("gorm log"), + log: l, Level: zap.WarnLevel, SlowThreshold: 100 * time.Millisecond, SkipCallerLookup: false,