Gorm has built-in logger support, default mode, it will only print logs when there are errors happened.
// Enable Logger, show detailed log
Refer GORM’s default logger for how to customize it https://github.com/jinzhu/gorm/blob/master/logger.go
For example, using Revel‘s Logger as the backend for GORM
os.Stdout as the backend
db.SetLogger(log.New(os.Stdout, "\r\n", 0))