// Levels implements logrus.Hook.
// It returns the logrus.Level's that are lower or equal to that of MinLevel.
// This means setting MinLevel to logrus.ErrorLevel will send slack messages for log entries at Error, Fatal and Panic.
543121
func (sh *Hook) Levels() []logrus.Level {
	lvls := make([]logrus.Level, 0, len(logrus.AllLevels))
	for _, l := range logrus.AllLevels {
		if sh.MinLevel >= l {
			lvls = append(lvls, l)
		}
	}

	return lvls
}
200999
func LogLevel(levelString string) (LoggingLevel, error) {
	l, err := logging.LogLevel(levelString)
	level := LoggingLevel(l)
	if err != nil {
		level = LogError
	}
	return level, err
}
513823
func (l *Logger) Level(args ...interface{}) interface{} {
	if len(args) == 0 {
		// implements log.Level() -> LOG_LEVEL
		lowestLevel := LogLevelInfo
		for _, stream := range l.streams {
			if toLogLevelInt(stream.Level) < toLogLevelInt(lowestLevel) {
				lowestLevel = strings.ToLower(stream.Level)
			}
		}
		return lowestLevel
	} else if typeName(args[0]) == "string" && toLogLevelInt(args[0].(string)) > 0 {
		// implements log.Level(LOG_LEVEL)
		for _, stream := range l.streams {
			stream.Level = strings.ToLower(args[0].(string))
		}
	}
	return nil
}
576628
func GetLevel(c context.Context) Level {
	if l, ok := c.Value(levelKey).(Level); ok {
		return l
	}
	return DefaultLevel
}
73430
func (s *XormLogger) Level() core.LogLevel {
	switch s.level {
	case glog.LvlError:
		return core.LOG_ERR
	case glog.LvlWarn:
		return core.LOG_WARNING
	case glog.LvlInfo:
		return core.LOG_INFO
	case glog.LvlDebug:
		return core.LOG_DEBUG
	default:
		return core.LOG_ERR
	}
}
594389
func (l *Logger) SetLevel(v string) {
	switch v {
	case "debug", "DEBUG":
		l.Level = logrus.DebugLevel
	case "info", "INFO":
		l.Level = logrus.InfoLevel
	case "warning", "WARNING":
		l.Level = logrus.WarnLevel
	case "error", "ERROR":
		l.Level = logrus.ErrorLevel
	case "fatal", "FATAL":
		l.Level = logrus.FatalLevel
	case "panic", "PANIC":
		l.Level = logrus.PanicLevel
	}
}
378085
func (l *Logger) Log(level Level, format string, a ...interface{}) {
	if level > l.MaxLevel || !l.open {
		return
	}
	message := format
	if len(a) > 0 {
		message = fmt.Sprintf(format, a...)
	}
	entry := &Entry{
		Category: l.Category,
		Level:    level,
		Message:  message,
		Time:     time.Now(),
	}
	if l.CallStackDepth > 0 {
		entry.CallStack = GetCallStack(3, l.CallStackDepth, l.CallStackFilter)
	}
	entry.FormattedMessage = l.Formatter(l, entry)
	l.entries <- entry
}
1076257
func SetHookLevel(level LevelType) {
	singltonLock.RLock()
	defer singltonLock.RUnlock()

	blog.SetHookLevel(level)
}
492521
func CheckLogLevel(level string) error {
	if !flogging.IsValidLevel(level) {
		return errors.Errorf("invalid log level provided - %s", level)
	}
	return nil
}
917944
func (hook *MailHook) Levels() []logrus.Level {
	return []logrus.Level{
		logrus.PanicLevel,
		logrus.FatalLevel,
		logrus.ErrorLevel,
	}
}
1121249
func SetLevel(level string) {
	lvl, err := log.ParseLevel(level)
	if err != nil {
		Fatal(fmt.Sprintf(`not a valid level: "%s"`, level))
	}
	log.SetLevel(lvl)
}
937855
func ParseLogLevel(level string) LogLevel {
	switch strings.ToLower(level) {
	case "debug":
		return DebugLevel
	case "info":
		return InfoLevel
	case "warn", "warning":
		return WarnLevel
	case "error":
		return ErrorLevel
	case "fatal":
		return FatalLevel
	case "panic":
		return PanicLevel
	default:
		return InfoLevel
	}
}
365230
func (l Levels) Info() log.Logger {
	return log.WithPrefix(l.logger, l.levelKey, l.infoValue)
}
670463
func LogLevelSet(levelWord string) {
	if lvl, ok := LogLevelWords[levelWord]; ok {
		LogLevel = lvl
	}
}
963042
func (s *NodesStatsService) Level(level string) *NodesStatsService {
	s.level = level
	return s
}
88373
func SetLevel(l Level) {
	if logger, ok := Log.(*Logger); ok {
		logger.Level = l
	}
}
1320200
func SetLogLevel(log *logrus.Logger, levelString string) error {
	level, err := logrus.ParseLevel(levelString)

	if err != nil {
		return err
	}

	log.Level = level

	return nil
}