From a7a7d3870223cff1ff50cc173913d8b4e6a11d25 Mon Sep 17 00:00:00 2001 From: Pavel Shevaev Date: Thu, 3 Nov 2022 17:28:35 +0300 Subject: [PATCH] Migrating to unified logger interface --- db.go | 5 ++--- db_test.go | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/db.go b/db.go index c5b1b01..d0f6200 100644 --- a/db.go +++ b/db.go @@ -73,10 +73,9 @@ func OpenPool(s Settings) *Pool { } func GetDBC(p *Pool, logger logr.Logger) *DBC { - 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) sess := con.NewSession(&EventReceiver{logger: logger, s: p.S}) diff --git a/db_test.go b/db_test.go index 0b52364..7697428 100644 --- a/db_test.go +++ b/db_test.go @@ -13,7 +13,7 @@ import ( "github.com/go-logr/stdr" ) -const verbosity = 0 +const verbosity = 0//2 var logger = stdr.New(log.New(os.Stdout, "", log.Lshortfile))