summaryrefslogtreecommitdiff
path: root/internal/db/bundb
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2022-04-18 16:47:11 +0200
committerLibravatar GitHub <noreply@github.com>2022-04-18 16:47:11 +0200
commit094f032f747b96733982108f2e184df88d9b25ae (patch)
treea36209e2ca052cae14a88c0a4adce61702766d90 /internal/db/bundb
parent[documentation] add screenshots to docs (#459) (diff)
downloadgotosocial-094f032f747b96733982108f2e184df88d9b25ae.tar.xz
[feature] Add log-db-queries config option (#465)
Diffstat (limited to 'internal/db/bundb')
-rw-r--r--internal/db/bundb/bundb.go4
1 files changed, 2 insertions, 2 deletions
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())
}