From 094f032f747b96733982108f2e184df88d9b25ae Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Mon, 18 Apr 2022 16:47:11 +0200 Subject: [feature] Add log-db-queries config option (#465) --- internal/db/bundb/bundb.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'internal/db/bundb') diff --git a/internal/db/bundb/bundb.go b/internal/db/bundb/bundb.go index f190ce5ea..a79e7e4f4 100644 --- a/internal/db/bundb/bundb.go +++ b/internal/db/bundb/bundb.go @@ -136,9 +136,9 @@ func NewBunDBService(ctx context.Context) (db.DB, error) { return nil, fmt.Errorf("database type %s not supported for bundb", dbType) } - // add a hook to just log queries and the time they take + // add a hook to log queries and the time they take // only do this for logging where performance isn't 1st concern - if logrus.GetLevel() >= logrus.DebugLevel { + if logrus.GetLevel() >= logrus.DebugLevel && viper.GetBool(config.Keys.LogDbQueries) { conn.DB.AddQueryHook(newDebugQueryHook()) } -- cgit v1.3