This configuration is not maintained anymore. You should think twice before using it, Breaking change and security issue will likely eventually happens as any abandonned project.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ( | |
log "github.com/sirupsen/logrus" | |
"github.com/jinzhu/gorm" | |
) | |
type GormLogger struct {} | |
func (*GormLogger) Print(v ...interface{}) { | |
if v[0] == "sql" { | |
log.WithFields(log.Fields{"module": "gorm", "type": "sql"}).Print(v[3]) |