aboutsummaryrefslogtreecommitdiff
path: root/internal/log.go
diff options
context:
space:
mode:
authorTill <2353100+S7evinK@users.noreply.github.com>2022-12-08 08:24:06 +0100
committerGitHub <noreply@github.com>2022-12-08 08:24:06 +0100
commit27a1dea5225c828ad787098aadafa83ed73c4940 (patch)
treec5844d7118a69b8cd17b0636182f6c57d0c16bf0 /internal/log.go
parentba2ffb7da9b86b64dc8091d90645ab80cf2831db (diff)
Fix issue with multiple/duplicate log entries during tests (#2906)
Diffstat (limited to 'internal/log.go')
-rw-r--r--internal/log.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/internal/log.go b/internal/log.go
index a171555a..d7e852c8 100644
--- a/internal/log.go
+++ b/internal/log.go
@@ -33,6 +33,11 @@ import (
"github.com/matrix-org/dendrite/setup/config"
)
+// logrus is using a global variable when we're using `logrus.AddHook`
+// this unfortunately results in us adding the same hook multiple times.
+// This map ensures we only ever add one level hook.
+var stdLevelLogAdded = make(map[logrus.Level]bool)
+
type utcFormatter struct {
logrus.Formatter
}