aboutsummaryrefslogtreecommitdiffhomepage
path: root/helpers/general.go
diff options
context:
space:
mode:
Diffstat (limited to 'helpers/general.go')
-rw-r--r--helpers/general.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/helpers/general.go b/helpers/general.go
index 236a763fa..472ebc4a4 100644
--- a/helpers/general.go
+++ b/helpers/general.go
@@ -360,9 +360,10 @@ func (l *DistinctLogger) printIfNotPrinted(level, logStatement string, print fun
return
}
l.Lock()
+ defer l.Unlock()
+ l.m[key] = true // Placing this after print() can cause duplicate warning entries to be logged when --panicOnWarning is true.
print()
- l.m[key] = true
- l.Unlock()
+
}
// NewDistinctErrorLogger creates a new DistinctLogger that logs ERRORs