From 7532b63f82725e1c288ef0d552452e860e9ef84f Mon Sep 17 00:00:00 2001 From: finkandreas Date: Tue, 11 Jul 2023 18:28:16 +0200 Subject: [PATCH] Fix #564 This could be a potential fix for #564 --- log.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/log.go b/log.go index 0b51676c..e6f6f7c0 100644 --- a/log.go +++ b/log.go @@ -309,7 +309,9 @@ func (l Logger) Sample(s Sampler) Logger { // Hook returns a logger with the h Hook. func (l Logger) Hook(h Hook) Logger { - l.hooks = append(l.hooks, h) + newHooks := make([]Hook, len(l.hooks), len(l.hooks)+1) + copy(newHooks, l.hooks) + l.hooks = append(newHooks, h) return l }