This could be a potential fix for #564
This commit is contained in:
finkandreas 2023-07-12 14:29:38 +02:00 committed by GitHub
parent 9070d49a1a
commit 61485f3857
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

4
log.go
View File

@ -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
}