diff options
author | 2022-04-18 16:47:11 +0200 | |
---|---|---|
committer | 2022-04-18 16:47:11 +0200 | |
commit | 094f032f747b96733982108f2e184df88d9b25ae (patch) | |
tree | a36209e2ca052cae14a88c0a4adce61702766d90 /internal/db/bundb | |
parent | [documentation] add screenshots to docs (#459) (diff) | |
download | gotosocial-094f032f747b96733982108f2e184df88d9b25ae.tar.xz |
[feature] Add log-db-queries config option (#465)
Diffstat (limited to 'internal/db/bundb')
-rw-r--r-- | internal/db/bundb/bundb.go | 4 |
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()) } |