Migrating to unified logger interface

This commit is contained in:
Pavel Shevaev 2022-11-03 12:53:08 +03:00
parent e0a3baffb9
commit 1d19526629
2 changed files with 5 additions and 4 deletions

2
db.go
View File

@ -75,7 +75,7 @@ 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)
logger = logger.WithValues("db_prefix", p.S.Prefix)
}
con := dbr.NewConnection(p.DB, nil)

View File

@ -17,6 +17,7 @@ var logger = stdr.New(log.New(os.Stdout, "", log.Lshortfile))
func getSettings() db.Settings {
//TODO: use ENV settings as well
//stdr.SetVerbosity(2)
return db.Settings{Host: "127.0.0.1", Port: "3306", User: "root", Pass: "test", Name: "tests", Prefix: "tests"}
}