diff --git a/logger.go b/logger.go index 2acab05..fdaf8a6 100644 --- a/logger.go +++ b/logger.go @@ -315,3 +315,9 @@ func (logger *Logger) level() Level { func (logger *Logger) SetLevel(level Level) { atomic.StoreUint32((*uint32)(&logger.Level), uint32(level)) } + +func (logger *Logger) AddHook(hook Hook) { + logger.mu.Lock() + defer logger.mu.Unlock() + logger.Hooks.Add(hook) +}