//GetLevel - getting log level for given module
436509
func GetLevel(module string) api.Level {
	rwmutex.RLock()
	defer rwmutex.RUnlock()
	return moduleLevels.GetLevel(module)
}
253761
func LoggerSetLevel(ctx context.Context, levelStr string) context.Context {
	logger := loggerFromContext(ctx)

	levelStr = strings.ToLower(levelStr)

	if levelStr == "debug" {
		logger.inDebug = true
	} else {
		logger.inDebug = false
	}

	level, err := log.LvlFromString(levelStr)
	if err != nil {
		Die("Cannot find log level : " + levelStr)
	}
	leveledBackend := log.LvlFilterHandler(level, logger.handler)
	logger.logger.SetHandler(leveledBackend)
	ctx = context.WithValue(ctx, LoggerKey, logger)
	return ctx
}
679432
func (logger *Logger) GetLevel() logging.LogLevel {
	unsafeStd := (*unsafe.Pointer)(unsafe.Pointer(&logger.std))
	stdVal := (*lg.Logger)(atomic.LoadPointer(unsafeStd))
	l := stdVal.Level
	switch l {
	case lg.PanicLevel:
		return logging.PanicLevel
	case lg.FatalLevel:
		return logging.FatalLevel
	case lg.ErrorLevel:
		return logging.ErrorLevel
	case lg.WarnLevel:
		return logging.WarnLevel
	case lg.InfoLevel:
		return logging.InfoLevel
	case lg.DebugLevel:
		return logging.DebugLevel
	default:
		return logging.DebugLevel
	}
}
283330
func (h *LoggingHook) Levels() []logrus.Level {
	return []logrus.Level{
		logrus.ErrorLevel,
		logrus.WarnLevel,
	}
}
1257053
func getDefaultLogLevel() log.Level {
	envVar := os.Getenv("AUTH_LOG_LEVEL")

	logLevel, err := log.ParseLevel(envVar)
	if err != nil {
		log.Warnf("unable to parse log level configuration error: %q", err)
		return log.InfoLevel // reset to INFO
	}
	return logLevel
}
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
}
1316900
func (c *ChaincodeLogger) SetLevel(level LoggingLevel) {
	logging.SetLevel(logging.Level(level), c.logger.Module)
}
627293
func SetLevel(module string, level api.Level) {
	rwmutex.Lock()
	defer rwmutex.Unlock()
	moduleLevels.SetLevel(module, level)
}
1277486
func getDefaultLogLevel() logrus.Level {
	config, err := configuration.New("")
	if err != nil {
		logrus.Errorf("error getting configuration data")
	}

	logLevel, err := logrus.ParseLevel(config.GetLogLevel())
	if err != nil {
		logrus.Warnf("unable to parse log level configuration error: %q", err)
		return logrus.InfoLevel // reset to INFO
	}
	return logLevel
}
810446
func getColorLevel(level string) string {
	level = strings.ToUpper(level)
	switch level {
	case "TRAC":
		return fmt.Sprintf("\033[%dm%s\033[0m", Blue, level)
	case "ERRO":
		return fmt.Sprintf("\033[%dm%s\033[0m", Red, level)
	case "WARN":
		return fmt.Sprintf("\033[%dm%s\033[0m", Magenta, level)
	case "SUCC":
		return fmt.Sprintf("\033[%dm%s\033[0m", Green, level)
	default:
		return level
	}
}
1229807
func (l *Logger) logWithLevel(logLvl LogLevel, data map[string]interface{}) {
	if logLvl < l.logLvl {
		// No log output
		return
	}
	data["level"] = logLvl.String()
	l.globalsL.RLock()
	defer l.globalsL.RUnlock()
	for key, value := range l.globals {
		if _, ok := data[key]; ok {
			// Values in the data map override the globals
			continue
		}
		data[key] = value
	}
	if l.logRouter != nil {
		data["_kvmeta"] = l.logRouter.Route(data)
	} else if globalRouter != nil {
		data["_kvmeta"] = globalRouter.Route(data)
	}

	l.fLogger.formatAndLog(data)
}
314717
func translateLevel(l logging.Level) int {
	switch l {
	case Suppress:
		return -1
	case logging.Error:
		return 0
	case logging.Warning, logging.Info:
		return 1
	default:
		return 2
	}
}
180069
func flagLogLevel(fs *flag.FlagSet, addr *logLevelArg, def string) {
	if def != "" {
		addr.Set(def)
	}
	fs.VarP(
		addr,
		"log-level",
		"l",
		`Sets the log level`)
}
769769
func IsEnabledForLogLevel(logLevel string) bool {
	lvl, _ := logging.LogLevel(logLevel)
	return chaincodeLogger.IsEnabledFor(lvl)
}
1076257
func SetHookLevel(level LevelType) {
	singltonLock.RLock()
	defer singltonLock.RUnlock()

	blog.SetHookLevel(level)
}
1028088
func GetLevel() Level {
	std.mu.Lock()
	defer std.mu.Unlock()
	return std.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
}