🎧 Your Personal Streaming Service
Go airsonicmadsonicmedia-servermusicmusic-servernavidromeopensubsonicraspberry-piself-hostedstreamerstreaming-apistreaming-audiosubsonicsubsonic-server
Integrate goose log with our own log system
Deluanc0243580c020
diff --git a/db/db.go b/db/db.goindex 79c8fa322..640861b89 100644--- a/db/db.go+++ b/db/db.go@@ -2,6 +2,7 @@ package dbimport ("database/sql"+ "fmt""os""sync"@@ -41,6 +42,7 @@ func Db() *sql.DB {func EnsureLatestVersion() {db := Db()+ goose.SetLogger(&logAdapter{})// Disable foreign_keys to allow re-creating tables in migrations_, err := db.Exec("PRAGMA foreign_keys=off")@@ -65,3 +67,27 @@ func EnsureLatestVersion() {os.Exit(1)}}++type logAdapter struct{}++func (l *logAdapter) Fatal(v ...interface{}) {+ log.Error(fmt.Sprint(v...))+ os.Exit(-1)+}++func (l *logAdapter) Fatalf(format string, v ...interface{}) {+ log.Error(fmt.Sprintf(format, v...))+ os.Exit(-1)+}++func (l *logAdapter) Print(v ...interface{}) {+ log.Info(fmt.Sprint(v...))+}++func (l *logAdapter) Println(v ...interface{}) {+ log.Info(fmt.Sprintln(v...))+}++func (l *logAdapter) Printf(format string, v ...interface{}) {+ log.Info(fmt.Sprintf(format, v...))+}