// getLogLevel returns the logging level defined via the KITE_LOG_LEVEL
// environment. It returns Info by default if no environment variable
// is set.
185006
func getLogLevel() Level {
	switch strings.ToUpper(os.Getenv("KITE_LOG_LEVEL")) {
	case "DEBUG":
		return DEBUG
	case "WARNING":
		return WARNING
	case "ERROR":
		return ERROR
	case "FATAL":
		return FATAL
	default:
		return INFO
	}
}
272209
func convertLevel(l Level) logging.Level {
	switch l {
	case DEBUG:
		return logging.DEBUG
	case WARNING:
		return logging.WARNING
	case ERROR:
		return logging.ERROR
	case FATAL:
		return logging.CRITICAL
	default:
		return logging.INFO
	}
}
1319770
func SetLogLevel(lv level) {
	if logLv != lv {
		logLv = lv
		if logLv <= DEBUG {
			lgr.SetFlags(log.LstdFlags | log.Lshortfile)
		} else {
			lgr.SetFlags(log.LstdFlags)
		}
	}
}
238887
func WithLogLevel(lvl string) DaemonOpt {
	return func(r *remote) error {
		r.Debug.Level = lvl
		return nil
	}
}
585692
func LogLevel(logType string) string {
	if _, ok := data.LogLevels[logType]; ok {
		return getRandValue([]string{"log_level", logType})
	}

	return getRandValue([]string{"log_level", "general"})
}
282150
func (config *Config) LogLevel() int {
	if config.ENV.CFLogLevel != "" {
		envVal, err := strconv.ParseInt(config.ENV.CFLogLevel, 10, 32)
		if err == nil {
			return int(envVal)
		}

		switch strings.ToLower(config.ENV.CFLogLevel) {
		case "fatal":
			return 1
		case "error":
			return 2
		case "warn":
			return 3
		case "info":
			return 4
		case "debug":
			return 5
		}
	}

	return 0
}
492521
func CheckLogLevel(level string) error {
	if !flogging.IsValidLevel(level) {
		return errors.Errorf("invalid log level provided - %s", level)
	}
	return nil
}
1343470
func GetLogLevel(ctx context.Context) (log.Level, bool) {
	if logCtx, ok := ctx.(*lsc); ok {
		return logCtx.logger.Level, true
	}
	return 0, false
}
1371399
func (engine *Engine) SetLogLevel(level core.LogLevel) {
	engine.logger.SetLevel(level)
}
462582
func (s *UpdateChannelInput) SetLogLevel(v string) *UpdateChannelInput {
	s.LogLevel = &v
	return s
}
922252
func (e *Envoy) ChangeLogLevel(level logrus.Level) {
	e.admin.changeLogLevel(level)
}
1104946
func GetLoggerLevel(loggerName string) string {
	return strings.ToUpper(Global.Level(loggerName).String())
}
996128
func (c *Config) WithLogLevel(level LogLevelType) *Config {
	c.LogLevel = &level
	return c
}
729742
func (c *ConfigLocal) VLogLevel() string {
	c.lock.RLock()
	defer c.lock.RUnlock()
	return c.vdebugSetting
}
1155390
func (w *bothWriter) logAtLevel(level syslog.Priority, msg string) {
	var prefix string
	var err error

	const red = "\033[31m\033[1m"
	const yellow = "\033[33m"

	switch syslogAllowed := int(level) <= w.syslogLevel; level {
	case syslog.LOG_ERR:
		if syslogAllowed {
			err = w.Err(msg)
		}
		prefix = red + "E"
	case syslog.LOG_WARNING:
		if syslogAllowed {
			err = w.Warning(msg)
		}
		prefix = yellow + "W"
	case syslog.LOG_INFO:
		if syslogAllowed {
			err = w.Info(msg)
		}
		prefix = "I"
	case syslog.LOG_DEBUG:
		if syslogAllowed {
			err = w.Debug(msg)
		}
		prefix = "D"
	default:
		err = w.Err(fmt.Sprintf("%s (unknown logging level: %d)", msg, int(level)))
	}

	if err != nil {
		fmt.Fprintf(os.Stderr, "Failed to write to syslog: %s (%s)\n", msg, err)
	}

	var reset string
	if strings.HasPrefix(prefix, "\033") {
		reset = "\033[0m"
	}

	if int(level) <= w.stdoutLevel {
		fmt.Printf("%s%s %s %s%s\n",
			prefix,
			w.clk.Now().Format("150405"),
			path.Base(os.Args[0]),
			msg,
			reset)
	}
}
362572
func GetLogger(ctx context.Context) *logrus.Entry {
	logger := ctx.Value(loggerKey{})

	if logger == nil {
		return L
	}

	return logger.(*logrus.Entry)
}
632947
func (s *DescribeChannelOutput) SetLogLevel(v string) *DescribeChannelOutput {
	s.LogLevel = &v
	return s
}