Add a hook to an instance of logger. This is called with `log.Hooks.Add(new(MyHook))` where `MyHook` implements the `Hook` interface.
(hook Hook)
| 16 | // Add a hook to an instance of logger. This is called with |
| 17 | // `log.Hooks.Add(new(MyHook))` where `MyHook` implements the `Hook` interface. |
| 18 | func (hooks LevelHooks) Add(hook Hook) { |
| 19 | for _, level := range hook.Levels() { |
| 20 | hooks[level] = append(hooks[level], hook) |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | // Fire all the hooks for the passed level. Used by `entry.log` to fire |
| 25 | // appropriate hooks for a log entry. |