MCPcopy
hub / github.com/sirupsen/logrus / ReplaceHooks

Method ReplaceHooks

logger.go:404–410  ·  view source on GitHub ↗

ReplaceHooks replaces the logger hooks and returns the old ones

(hooks LevelHooks)

Source from the content-addressed store, hash-verified

402
403// ReplaceHooks replaces the logger hooks and returns the old ones
404func (logger *Logger) ReplaceHooks(hooks LevelHooks) LevelHooks {
405 logger.mu.Lock()
406 oldHooks := logger.Hooks
407 logger.Hooks = hooks
408 logger.mu.Unlock()
409 return oldHooks
410}
411
412// SetBufferPool sets the logger buffer pool.
413func (logger *Logger) SetBufferPool(pool BufferPool) {

Callers 1

TestReplaceHooksFunction · 0.80

Calls 2

LockMethod · 0.80
UnlockMethod · 0.80

Tested by 1

TestReplaceHooksFunction · 0.64