// SetLogger assigns the logger to use as well as a level
//
// The logger parameter is an interface that requires the following
// method to be implemented (such as the the stdlib log.Logger):
//
//    Output(calldepth int, s string)
//
175182
func (r *Consumer) SetLogger(l logger, lvl LogLevel) {
	r.logGuard.Lock()
	defer r.logGuard.Unlock()

	r.logger = l
	r.logLvl = lvl
}
462582
func (s *UpdateChannelInput) SetLogLevel(v string) *UpdateChannelInput {
	s.LogLevel = &v
	return s
}
476027
func (l *intLogger) SetLevel(level Level) {
	atomic.StoreInt32(l.level, int32(level))
}
1310548
func (w *Producer) SetLogger(l logger, lvl LogLevel) {
	w.logGuard.Lock()
	defer w.logGuard.Unlock()

	w.logger = l
	w.logLvl = lvl
}
234230
func (em *EventMeter) SetLogger(l log.Logger) {
	em.logger = l
	em.wsc.SetLogger(l.With("module", "rpcclient"))
}
660463
func SetLevel(level string) {
	if l, ok := instance.(*log.Logger); ok {
		err := l.SetLevel(level)
		if err != nil {
			Fatalf(nil, fmt.Sprintf(`log level not valid: "%s"`, level))
		}
	}
}
707929
func SetLevel(lo Logger, pr Priority) (err error) {
	err = list.SetLevel(lo, pr)
	if err != nil {
		return
	}

	return
}
957323
func (c *Conn) SetLogger(logger Logger) Logger {
	oldLogger := c.logger
	c.logger = logger
	return oldLogger
}
415288
func (s *StreamingDistributionConfig) SetLogging(v *StreamingLoggingConfig) *StreamingDistributionConfig {
	s.Logging = v
	return s
}
678020
func (cs *ConsensusState) SetLogger(l log.Logger) {
	cs.BaseService.Logger = l
	cs.timeoutTicker.SetLogger(l)
}
1110769
func (s *ChannelSummary) SetLogLevel(v string) *ChannelSummary {
	s.LogLevel = &v
	return s
}
1366018
func InitLogger(purpose LoggingPurpose, level log.Level, verbose ...bool) {
	log.StandardLogger().SetHooks(make(log.LevelHooks))
	log.SetLevel(level)

	switch purpose {
	case LoggingForCLI:
		// If debug logging was asked for on the CLI, then write logs to stderr.
		// Otherwise discard all logs.
		if level == log.DebugLevel {
			log.SetFormatter(&trace.TextFormatter{
				DisableTimestamp: true,
				EnableColors:     trace.IsTerminal(os.Stderr),
			})
			log.SetOutput(os.Stderr)
		} else {
			log.SetOutput(ioutil.Discard)
		}
	case LoggingForDaemon:
		log.SetFormatter(&trace.TextFormatter{
			DisableTimestamp: true,
			EnableColors:     trace.IsTerminal(os.Stderr),
		})
		log.SetOutput(os.Stderr)
	case LoggingForTests:
		log.SetFormatter(&trace.TextFormatter{
			DisableTimestamp: true,
			EnableColors:     true,
		})
		log.SetLevel(level)
		log.SetOutput(os.Stderr)
		if len(verbose) != 0 && verbose[0] {
			return
		}
		val, _ := strconv.ParseBool(os.Getenv(teleport.VerboseLogsEnvVar))
		if val {
			return
		}
		val, _ = strconv.ParseBool(os.Getenv(teleport.DebugEnvVar))
		if val {
			return
		}
		log.SetLevel(log.WarnLevel)
		log.SetOutput(ioutil.Discard)
	}
}
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)
	}
}
917863
func (bcR *BlockchainReactor) SetLogger(l log.Logger) {
	bcR.BaseService.Logger = l
	bcR.pool.Logger = l
}
922685
func (s *CreateGraphqlApiInput) SetLogConfig(v *LogConfig) *CreateGraphqlApiInput {
	s.LogConfig = v
	return s
}
848483
func SetLogger(l Logger) Logger {
	logMux.Lock()
	defer logMux.Unlock()
	old := logBackend
	logBackend = l
	return old
}
110320
func (s *LoggingOptionsPayload) SetLogLevel(v string) *LoggingOptionsPayload {
	s.LogLevel = &v
	return s
}