MCPcopy
hub / github.com/rs/zerolog / Hook

Method Hook

log.go:328–336  ·  view source on GitHub ↗

Hook returns a logger with the h Hook.

(hooks ...Hook)

Source from the content-addressed store, hash-verified

326
327// Hook returns a logger with the h Hook.
328func (l Logger) Hook(hooks ...Hook) Logger {
329 if len(hooks) == 0 {
330 return l
331 }
332 newHooks := make([]Hook, len(l.hooks), len(l.hooks)+len(hooks))
333 copy(newHooks, l.hooks)
334 l.hooks = append(newHooks, hooks...)
335 return l
336}
337
338// Trace starts a new message with trace level.
339//

Callers 9

ExampleLogger_HookFunction · 0.80
TestHookFunction · 0.80
BenchmarkHooksFunction · 0.80
ExampleLogger_HookFunction · 0.80
TimestampMethod · 0.80
CallerMethod · 0.80
HookFunction · 0.80

Calls

no outgoing calls

Tested by 5

ExampleLogger_HookFunction · 0.64
TestHookFunction · 0.64
BenchmarkHooksFunction · 0.64
ExampleLogger_HookFunction · 0.64