// validLogLevel returns whether or not logLevel is a valid debug log level.
167430
func validLogLevel(logLevel string) bool {
	_, ok := slog.LevelFromString(logLevel)
	return ok
}
1176804
func (l *intLogger) IsDebug() bool {
	return Level(atomic.LoadInt32(l.level)) <= Debug
}
1154928
func (ditr debugIterator) Valid() (ok bool) {
	defer func() {
		fmt.Printf("%v.itr.Valid() %v\n", ditr.label, ok)
	}()
	ok = ditr.itr.Valid()
	return
}
279784
func SetLogLevel(logLevel string) {
	level, err := log.ParseLevel(logLevel)
	errors.CheckError(err)
	log.SetLevel(level)
	if os.Getenv("FORCE_LOG_COLORS") == "1" {
		log.SetFormatter(&log.TextFormatter{ForceColors: true})
	}
}
692295
func (l *ConsoleLogger) Level(o int) {
	if o >= 0 && o <= len(l.levels)-1 {
		l.outLevel = o
	}
}
769769
func IsEnabledForLogLevel(logLevel string) bool {
	lvl, _ := logging.LogLevel(logLevel)
	return chaincodeLogger.IsEnabledFor(lvl)
}
984714
func (s *CreateChannelInput) SetLogLevel(v string) *CreateChannelInput {
	s.LogLevel = &v
	return s
}
426962
func (m *AccessLogFilter) Validate() error {
	if m == nil {
		return nil
	}

	switch m.FilterSpecifier.(type) {

	case *AccessLogFilter_StatusCodeFilter:

		{
			tmp := m.GetStatusCodeFilter()

			if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

				if err := v.Validate(); err != nil {
					return AccessLogFilterValidationError{
						field:  "StatusCodeFilter",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		}

	case *AccessLogFilter_DurationFilter:

		{
			tmp := m.GetDurationFilter()

			if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

				if err := v.Validate(); err != nil {
					return AccessLogFilterValidationError{
						field:  "DurationFilter",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		}

	case *AccessLogFilter_NotHealthCheckFilter:

		{
			tmp := m.GetNotHealthCheckFilter()

			if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

				if err := v.Validate(); err != nil {
					return AccessLogFilterValidationError{
						field:  "NotHealthCheckFilter",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		}

	case *AccessLogFilter_TraceableFilter:

		{
			tmp := m.GetTraceableFilter()

			if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

				if err := v.Validate(); err != nil {
					return AccessLogFilterValidationError{
						field:  "TraceableFilter",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		}

	case *AccessLogFilter_RuntimeFilter:

		{
			tmp := m.GetRuntimeFilter()

			if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

				if err := v.Validate(); err != nil {
					return AccessLogFilterValidationError{
						field:  "RuntimeFilter",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		}

	case *AccessLogFilter_AndFilter:

		{
			tmp := m.GetAndFilter()

			if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

				if err := v.Validate(); err != nil {
					return AccessLogFilterValidationError{
						field:  "AndFilter",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		}

	case *AccessLogFilter_OrFilter:

		{
			tmp := m.GetOrFilter()

			if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

				if err := v.Validate(); err != nil {
					return AccessLogFilterValidationError{
						field:  "OrFilter",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		}

	case *AccessLogFilter_HeaderFilter:

		{
			tmp := m.GetHeaderFilter()

			if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

				if err := v.Validate(); err != nil {
					return AccessLogFilterValidationError{
						field:  "HeaderFilter",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		}

	case *AccessLogFilter_ResponseFlagFilter:

		{
			tmp := m.GetResponseFlagFilter()

			if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

				if err := v.Validate(); err != nil {
					return AccessLogFilterValidationError{
						field:  "ResponseFlagFilter",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		}

	case *AccessLogFilter_GrpcStatusFilter:

		{
			tmp := m.GetGrpcStatusFilter()

			if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

				if err := v.Validate(); err != nil {
					return AccessLogFilterValidationError{
						field:  "GrpcStatusFilter",
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		}

	default:
		return AccessLogFilterValidationError{
			field:  "FilterSpecifier",
			reason: "value is required",
		}

	}

	return nil
}
733662
func (lr *logRegistry) GetLevel(logger string) (string, error) {
	logVal := lr.getLoggerFromMapping(logger)
	if logVal == nil {
		return "", fmt.Errorf("logger %s not found", logger)
	}
	return logVal.GetLevel().String(), nil
}
1319770
func SetLogLevel(lv level) {
	if logLv != lv {
		logLv = lv
		if logLv <= DEBUG {
			lgr.SetFlags(log.LstdFlags | log.Lshortfile)
		} else {
			lgr.SetFlags(log.LstdFlags)
		}
	}
}
771799
func (logger *Logger) LogLevel(level log.Level) bool {
	return logger.threshold >= level
}
165047
func IsLogging(c context.Context, l Level) bool {
	return l >= GetLevel(c)
}
34485
func SetLogLevel(level string) {
	switch strings.ToLower(level) {
	case "debug":
		log.SetLevel(log.DebugLevel)
	case "info":
		log.SetLevel(log.InfoLevel)
	case "warn":
		log.SetLevel(log.WarnLevel)
	case "error":
		log.SetLevel(log.ErrorLevel)
	default:
		log.Fatalf("Unknown level: %s", level)
	}
}
996128
func (c *Config) WithLogLevel(level LogLevelType) *Config {
	c.LogLevel = &level
	return c
}
133870
func (sw syslogWriter) WriteLevel(level Level, p []byte) (n int, err error) {
	switch level {
	case DebugLevel:
		err = sw.w.Debug(string(p))
	case InfoLevel:
		err = sw.w.Info(string(p))
	case WarnLevel:
		err = sw.w.Warning(string(p))
	case ErrorLevel:
		err = sw.w.Err(string(p))
	case FatalLevel:
		err = sw.w.Emerg(string(p))
	case PanicLevel:
		err = sw.w.Crit(string(p))
	case NoLevel:
		err = sw.w.Info(string(p))
	default:
		panic("invalid level")
	}
	n = len(p)
	return
}
563728
func initLogLevels(c *CompositeMultiHandler, basePath string, config *config.Context) {
	for _, name := range []string{"debug", "info", "warn", "error", "crit",
		"trace", // TODO trace is deprecated
	} {
		if config != nil {
			extraLogFlag := config.BoolDefault(SPECIAL_USE_FLAG, false)
			output, found := config.String("log." + name + ".output")
			if found {
				if extraLogFlag {
					log.Printf("Adding standard handler %s output %s", name, output)
				}
				initHandlerFor(c, output, basePath, NewLogOptions(config, true, nil, toLevel[name]))
			}
			// Gets the list of options with said prefix
		} else {
			initHandlerFor(c, "stderr", basePath, NewLogOptions(config, true, nil, toLevel[name]))
		}
	}
}
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
	}
}