Skip to content

Commit

Permalink
Fix rs#564
Browse files Browse the repository at this point in the history
This could be a potential fix for rs#564
  • Loading branch information
finkandreas committed Jul 11, 2023
1 parent 9070d49 commit 7532b63
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion log.go
Expand Up @@ -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
}

Expand Down

0 comments on commit 7532b63

Please sign in to comment.