1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

refactor: include logging framework (resolve #92)

This commit is contained in:
Ferdinand Mütsch
2021-01-30 11:17:37 +01:00
parent fd239e4f21
commit 617d9ad7e4
16 changed files with 80 additions and 77 deletions

View File

@@ -1,9 +1,9 @@
package common
import (
"github.com/emvi/logbuch"
"github.com/muety/wakapi/config"
"gorm.io/gorm"
"log"
)
var customPostMigrations []migrationFunc
@@ -22,9 +22,9 @@ func init() {
func RunCustomPostMigrations(db *gorm.DB, cfg *config.Config) {
for _, m := range customPostMigrations {
log.Printf("potentially running migration '%s'\n", m.name)
logbuch.Info("potentially running migration '%s'", m.name)
if err := m.f(db, cfg); err != nil {
log.Fatalf("migration '%s' failed %v\n", m.name, err)
logbuch.Fatal("migration '%s' failed %v", m.name, err)
}
}
}