Migrating to unified logger interface

This commit is contained in:
Pavel Shevaev 2022-11-03 17:28:35 +03:00
parent dfef872327
commit a7a7d38702
2 changed files with 3 additions and 4 deletions

3
db.go
View File

@ -73,9 +73,8 @@ 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_prefix", p.S.Prefix) logger = logger.WithName(p.S.Prefix)
} }
con := dbr.NewConnection(p.DB, nil) con := dbr.NewConnection(p.DB, nil)

View File

@ -13,7 +13,7 @@ import (
"github.com/go-logr/stdr" "github.com/go-logr/stdr"
) )
const verbosity = 0 const verbosity = 0//2
var logger = stdr.New(log.New(os.Stdout, "", log.Lshortfile)) var logger = stdr.New(log.New(os.Stdout, "", log.Lshortfile))