diff --git a/db.go b/db.go index 74193d2..c5b1b01 100644 --- a/db.go +++ b/db.go @@ -74,9 +74,9 @@ func OpenPool(s Settings) *Pool { func GetDBC(p *Pool, logger logr.Logger) *DBC { - if len(p.S.Prefix) > 0 { - logger = logger.WithValues("db", p.S.Prefix) - } + if len(p.S.Prefix) > 0 { + logger = logger.WithValues("db_prefix", p.S.Prefix) + } con := dbr.NewConnection(p.DB, nil) sess := con.NewSession(&EventReceiver{logger: logger, s: p.S}) diff --git a/db_test.go b/db_test.go index f884743..65bb2e1 100644 --- a/db_test.go +++ b/db_test.go @@ -17,7 +17,8 @@ var logger = stdr.New(log.New(os.Stdout, "", log.Lshortfile)) func getSettings() db.Settings { //TODO: use ENV settings as well - return db.Settings{Host: "127.0.0.1", Port: "3306", User: "root", Pass: "test", Name: "tests", Prefix: "tests"} + //stdr.SetVerbosity(2) + return db.Settings{Host: "127.0.0.1", Port: "3306", User: "root", Pass: "test", Name: "tests", Prefix: "tests"} } func getPool() *db.Pool {