enable sql debug if loglevel is set to debug
This commit is contained in:
4
main.go
4
main.go
@@ -76,6 +76,10 @@ func main() {
|
|||||||
}(db)
|
}(db)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if log.GetLevel() == log.DebugLevel {
|
||||||
|
db = db.Debug()
|
||||||
|
}
|
||||||
|
|
||||||
if err := db.Schema.Create(context.Background()); err != nil {
|
if err := db.Schema.Create(context.Background()); err != nil {
|
||||||
log.Panicf("automigrate failed: %v", err)
|
log.Panicf("automigrate failed: %v", err)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user