Beispiel #1
0
// Levels contains hook levels to be catched
func (hook *logHook) Levels() []logrus.Level {
	levels := []logrus.Level{}
	for _, v := range hook.LevelsParam {
		lv, _ := logrus.ParseLevel(v)
		levels = append(levels, lv)
	}
	return levels
}
Beispiel #2
0
func logLevel(level configuration.Loglevel) log.Level {
	l, err := log.ParseLevel(string(level))
	if err != nil {
		l = log.InfoLevel
		log.Warnf("error parsing level %q: %v, using %q	", level, err, l)
	}

	return l
}