Migrating to unified logger interface
This commit is contained in:
parent
e0a3baffb9
commit
1d19526629
2
db.go
2
db.go
|
@ -75,7 +75,7 @@ func OpenPool(s Settings) *Pool {
|
||||||
func GetDBC(p *Pool, logger logr.Logger) *DBC {
|
func GetDBC(p *Pool, logger logr.Logger) *DBC {
|
||||||
|
|
||||||
if len(p.S.Prefix) > 0 {
|
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)
|
con := dbr.NewConnection(p.DB, nil)
|
||||||
|
|
|
@ -17,6 +17,7 @@ var logger = stdr.New(log.New(os.Stdout, "", log.Lshortfile))
|
||||||
|
|
||||||
func getSettings() db.Settings {
|
func getSettings() db.Settings {
|
||||||
//TODO: use ENV settings as well
|
//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"}
|
return db.Settings{Host: "127.0.0.1", Port: "3306", User: "root", Pass: "test", Name: "tests", Prefix: "tests"}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue