AddHook adds a new hook to the handler.
(hook Hook)
| 74 | |
| 75 | // AddHook adds a new hook to the handler. |
| 76 | func (h *Handler) AddHook(hook Hook) { |
| 77 | if hook == nil { |
| 78 | return |
| 79 | } |
| 80 | |
| 81 | h.mu.Lock() |
| 82 | defer h.mu.Unlock() |
| 83 | |
| 84 | h.hooks = append(h.hooks, hook) |
| 85 | } |
| 86 | |
| 87 | // Level returns the minimum log level for the handler. |
| 88 | func (h *Handler) Level() slog.Leveler { |