photoprism/internal/event/init.go
Michael Mayer f5a8c5a45d Auth: Session and ACL enhancements #98 #1746
Signed-off-by: Michael Mayer <michael@photoprism.app>
2022-09-28 09:01:17 +02:00

29 lines
560 B
Go

package event
import (
"os"
"github.com/sirupsen/logrus"
"github.com/photoprism/photoprism/pkg/dummy"
)
// init initializes the event package.
func init() {
// Event hooks for the default logger.
hooks := logrus.LevelHooks{}
hooks.Add(NewHook(SharedHub()))
// Log is the global default logger.
Log = &logrus.Logger{
Out: os.Stderr,
Formatter: TextFormatter,
Hooks: hooks,
Level: logrus.DebugLevel,
ExitFunc: os.Exit,
ReportCaller: false,
}
// Create dummy audit logger.
AuditLog = dummy.NewLogger()
}