photoprism/internal/event/init.go
Michael Mayer 2de1e338bd Logs: Prevent feedback loops by omitting repeated messages #2335
This also prevents debug and trace messages to be sent to the frontend.
2022-05-20 11:31:39 +02:00

21 lines
344 B
Go

package event
import (
"os"
"github.com/sirupsen/logrus"
)
func init() {
hooks := logrus.LevelHooks{}
hooks.Add(NewHook(SharedHub()))
Log = &logrus.Logger{
Out: os.Stderr,
Formatter: &logrus.TextFormatter{},
Hooks: hooks,
Level: logrus.DebugLevel,
ExitFunc: os.Exit,
ReportCaller: false,
}
}