parent
9070d49a1a
commit
61485f3857
4
log.go
4
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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue