Skip to content

Instantly share code, notes, and snippets.

View dreh23's full-sized avatar

Johannes Amorosa dreh23

View GitHub Profile
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])