Skip to content

Commit

Permalink
Fix rs#564 (rs#565)
Browse files Browse the repository at this point in the history
This could be a potential fix for rs#564
  • Loading branch information
finkandreas authored and mAdkins committed Mar 2, 2024
1 parent 6433c38 commit 28cc6ac
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion log.go
Original file line number Diff line number Diff line change
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 28cc6ac

Please sign in to comment.