16 lines
318 B
Go
16 lines
318 B
Go
package log
|
|
|
|
import (
|
|
"go.uber.org/zap"
|
|
"gorm.io/gorm/logger"
|
|
gormLogger "gorm.io/gorm/logger"
|
|
"moul.io/zapgorm2"
|
|
)
|
|
|
|
func GormZapLogger() logger.Interface {
|
|
l := zapgorm2.New(zap.L())
|
|
l.SetAsDefault() // optional: configure gorm to use this zapgorm.Logger for callbacks
|
|
l.LogLevel = gormLogger.Info
|
|
return l
|
|
}
|