authelia/internal/logging/logger.go
2019-12-11 19:01:16 +01:00

23 lines
528 B
Go

package logging
import (
logrus_stack "github.com/Gurpartap/logrus-stack"
"github.com/sirupsen/logrus"
)
func init() {
callerLevels := []logrus.Level{}
stackLevels := []logrus.Level{logrus.PanicLevel, logrus.FatalLevel, logrus.ErrorLevel}
logrus.AddHook(logrus_stack.NewHook(callerLevels, stackLevels))
}
// Logger return the standard logrues logger.
func Logger() *logrus.Logger {
return logrus.StandardLogger()
}
// SetLevel set the level of the logger.
func SetLevel(level logrus.Level) {
logrus.SetLevel(level)
}