// you can set a logger, and log level,most common usage is:
//
//	gou.SetLogger(log.New(os.Stdout, "", log.LstdFlags), "debug")
//
//  loglevls:   debug, info, warn, error, fatal
// Note, that you can also set a separate Error Log Level
339539
func SetLogger(l *log.Logger, logLevel string) {
	logger = l
	LogLevelSet(logLevel)
}
940138
func (s *MonitoringConfiguration) SetLogLevel(v string) *MonitoringConfiguration {
	s.LogLevel = &v
	return s
}
984714
func (s *CreateChannelInput) SetLogLevel(v string) *CreateChannelInput {
	s.LogLevel = &v
	return s
}
868931
func Logger(args ...string) logger.Logger {
	var name string
	if len(args) > 0 {
		name = args[0]
	} else {
		name = ""
	}

	if global == nil {
		global = logger.New("")
		global.SetLevel(levels.DEBUG)
	}

	l := global.GetLogger(name)

	return l
}
803155
func (c Capabilities) SetLogLevel(typ log.Type, level log.Level) {
	if _, ok := c[log.CapabilitiesKey]; !ok {
		c[log.CapabilitiesKey] = make(log.Capabilities)
	}
	m := c[log.CapabilitiesKey].(log.Capabilities)
	m[typ] = level
}
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)
	}
}
900903
func (l *DefaultLogger) Log(level int, msg string, args []interface{}) {
	// log if the log level (warn=4) >= level of message (err=3)
	if l.level < level || silent {
		return
	}
	l.formatter.Format(l.writer, level, msg, args)
}
728211
func (lgr *logger) SetLogger(l genericLogger) {
	lgr.mutex.Lock()
	defer lgr.mutex.Unlock()

	lgr.Logger = l
}
1073137
func (s *StanLogger) SetLogger(log Logger, logtime, debug, trace bool, logfile string) {
	s.mu.Lock()
	s.log = log
	s.ltime = logtime
	s.debug = debug
	s.trace = trace
	s.lfile = logfile
	s.mu.Unlock()
}
110320
func (s *LoggingOptionsPayload) SetLogLevel(v string) *LoggingOptionsPayload {
	s.LogLevel = &v
	return s
}
38650
func (s *StopChannelOutput) SetLogLevel(v string) *StopChannelOutput {
	s.LogLevel = &v
	return s
}
764513
func (gr *GoReq) SetLogger(logger *log.Logger) *GoReq {
	gr.logger = logger
	return gr
}
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})
	}
}
991629
func SetLogger(l Logger) ClientOption {
	return func(config *RealisConfig) {
		config.logger = &LevelLogger{Logger: l}
	}
}
336581
func setLogLevel(backend core.ConfigBackend) {
	loggingLevelString, _ := backend.Lookup("client.logging.level")
	logLevel := logging.INFO
	if loggingLevelString != nil {
		var err error
		logLevel, err = logging.LogLevel(loggingLevelString.(string))
		if err != nil {
			panic(err)
		}
	}

	// TODO: allow separate settings for each
	for _, logModule := range logModules {
		logging.SetLevel(logModule, logLevel)
	}
}
917920
func (logger *Logger) SetLevel(level Level) {
	atomic.StoreInt32((*int32)(&logger.level), int32(level))
}
240295
func (s *MonitoringConfigurationDescription) SetLogLevel(v string) *MonitoringConfigurationDescription {
	s.LogLevel = &v
	return s
}