// Level returns stats aggregated at cluster, index or shard level.
350201
func (s *IndicesStatsService) Level(level string) *IndicesStatsService {
	s.level = level
	return s
}
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)
}
216273
func LogLevel(level string) (Level, error) {
	l, err := metadata.ParseLevel(level)
	return Level(l), err
}
998188
func (s *Permission) SetLevel(v string) *Permission {
	s.Level = &v
	return s
}
407740
func (r *Hook) Levels() []logrus.Level {
	if r.triggers == nil {
		return defaultTriggerLevels
	}
	return r.triggers
}
930769
func (logger *Logger) SetLevel(level Level) {
	l, err := parseLevel(level)
	if err != nil {
		fmt.Printf("%v", err)
	}

	logger.mu.Lock()
	defer logger.mu.Unlock()
	logger.Level = l
}
576628
func GetLevel(c context.Context) Level {
	if l, ok := c.Value(levelKey).(Level); ok {
		return l
	}
	return DefaultLevel
}
581812
func AllLevels() sets.String {
	return sets.NewString(
		string(audit.LevelNone),
		string(audit.LevelMetadata),
		string(audit.LevelRequest),
		string(audit.LevelRequestResponse),
	)
}
1263662
func (l *Logger) Levels(args ...interface{}) interface{} {
	argl := len(args)

	switch argl {
	case 0:
		// implements log.Levels() -> [STREAM_LEVEL_0, ...]
		logLevels := make([]string, 0)
		for _, stream := range l.streams {
			logLevels = append(logLevels, stream.Level)
		}
		return logLevels
	case 1:
		switch typeName(args[0]) {
		case "int":
			// implements log.Levels(STREAM_INDEX)
			if len(l.streams) >= (args[0].(int) + 1) {
				return l.streams[args[0].(int)].Level
			}
			return ""
		case "string":
			// implements log.Levels(STREAM_NAME)
			for _, stream := range l.streams {
				if stream.Name == args[0].(string) {
					return stream.Level
				}
			}
		}
	case 2:
		if typeName(args[1]) == "string" && toLogLevelInt(args[1].(string)) > 0 {
			switch typeName(args[0]) {
			case "int":
				// implements log.Levels(STREAM_INDEX, LOG_LEVEL)
				if len(l.streams) >= (args[0].(int) + 1) {
					l.streams[args[0].(int)].Level = strings.ToLower(args[1].(string))
				}
			case "string":
				// implements log.Levels(STREAM_NAME, LOG_LEVEL)
				for _, stream := range l.streams {
					if stream.Name == args[0].(string) {
						stream.Level = strings.ToLower(args[1].(string))
					}
				}
			}
		}
	}

	return nil
}
1228086
func (logger *Logger) GetLevel() Level {
	logger.mu.Lock()
	defer logger.mu.Unlock()
	return logger.Level
}
523042
func CheckLevel(level string) error {
	if _, err := log.ParseLevel(level); err != nil {
		return fmt.Errorf(`log level not valid: "%s"`, level)
	}
	return nil
}
1166555
func (blog *BLog) SetLevel(level LevelType) *BLog {
	blog.level = level
	return blog
}
35718
func GetLevel(logger *logrus.Logger) logrus.Level {
	return logrus.Level(atomic.LoadUint32((*uint32)(&logger.Level)))
}
1312469
func (e TabletStats) GetHostNameLevel(level int) string {
	chunkedHostname := strings.Split(e.Tablet.Hostname, ".")

	if level < 0 {
		return chunkedHostname[0]
	} else if level >= len(chunkedHostname) {
		return chunkedHostname[len(chunkedHostname)-1]
	} else {
		return chunkedHostname[level]
	}
}
950584
func (t *tsmGeneration) level() int {
	// Level 0 is always created from the result of a cache compaction.  It generates
	// 1 file with a sequence num of 1.  Level 2 is generated by compacting multiple
	// level 1 files.  Level 3 is generate by compacting multiple level 2 files.  Level
	// 4 is for anything else.
	_, seq, _ := t.parseFileName(t.files[0].Path)
	if seq < 4 {
		return seq
	}

	return 4
}
917944
func (hook *MailHook) Levels() []logrus.Level {
	return []logrus.Level{
		logrus.PanicLevel,
		logrus.FatalLevel,
		logrus.ErrorLevel,
	}
}
200999
func LogLevel(levelString string) (LoggingLevel, error) {
	l, err := logging.LogLevel(levelString)
	level := LoggingLevel(l)
	if err != nil {
		level = LogError
	}
	return level, err
}