mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-17 17:47:03 +00:00
16 lines
340 B
Go
16 lines
340 B
Go
package smtp
|
|
|
|
import "github.com/rs/zerolog"
|
|
|
|
type logHook struct{}
|
|
|
|
// Run implements a zerolog hook that updates the SMTP warning/error expvars.
|
|
func (h logHook) Run(e *zerolog.Event, level zerolog.Level, msg string) {
|
|
switch level {
|
|
case zerolog.WarnLevel:
|
|
expWarnsTotal.Add(1)
|
|
case zerolog.ErrorLevel:
|
|
expErrorsTotal.Add(1)
|
|
}
|
|
}
|