// Set the handler for the logger
// This should *only* be called to set the handler for the actual backend (syslog, file, ...) and not when leveling the handler as LoggerStruct.handler is the logger non-leveled handler
762677
func (l *LoggerStruct) SetHandler(handler log.Handler) {
	l.handler = handler
	l.logger.SetHandler(l.handler)
}
529894
func (b *serverBuilder) SetEventHandler(event ServerBuildEvents, handler ServerBuildEventHandler) {
	b.buildEventHandlers[event] = handler
}
1117462
func (s *Service) initLogger() {
	log.SetLevel(s.options.LogSeverity.S)
	// If LogFormatter is specified then Log is ignored.
	if s.options.LogFormatter != nil {
		log.SetOutput(os.Stdout)
		log.SetFormatter(s.options.LogFormatter)
		return
	}
	if s.options.Log == "console" {
		log.SetOutput(os.Stdout)
		log.SetFormatter(&log.TextFormatter{})
		return
	}
	var err error
	if s.options.Log == "syslog" {
		var devNull *os.File
		devNull, err = os.OpenFile("/dev/null", os.O_WRONLY, 0)
		if err == nil {
			var hook *logrus_syslog.SyslogHook
			hook, err = logrus_syslog.NewSyslogHook("udp", "127.0.0.1:514", syslog.LOG_INFO|syslog.LOG_MAIL, "vulcand")
			if err == nil {
				log.SetOutput(devNull)
				log.SetFormatter(&log.TextFormatter{DisableColors: true})
				log.AddHook(hook)
				return
			}
		}
	}
	if s.options.Log == "json" {
		log.SetOutput(os.Stdout)
		log.SetFormatter(&log.JSONFormatter{})
		return
	}
	if s.options.Log == "logstash" {
		log.SetOutput(os.Stdout)
		log.SetFormatter(&logrus_logstash.LogstashFormatter{Fields: log.Fields{"type": "logs"}})
		return
	}
	log.SetOutput(os.Stdout)
	log.SetFormatter(&log.TextFormatter{})
	log.Warnf("Failed to initialized logger. Fallback to default: logger=%s, err=(%s)", s.options.Log, err)
}
678020
func (cs *ConsensusState) SetLogger(l log.Logger) {
	cs.BaseService.Logger = l
	cs.timeoutTicker.SetLogger(l)
}
707348
func SetLogger(logger Logger) {
	globalLock.Lock()
	defer globalLock.Unlock()
	if globalLevelSet {
		logger = logger.AtLevel(globalLevel)
	}
	globalLogger = logger
}
1358789
func SetDeleteHandler(r chi.Router, del rw.Deleter) {
	handler := func(w http.ResponseWriter, r *http.Request) {
		id := chi.URLParam(r, "id")
		if err := del.Delete(id); err != nil {
			http.Error(w, http.StatusText(500), 500)
		} else {
			http.Error(w, http.StatusText(204), 204)
		}
	}

	r.Delete("/{id}", handler)
}
695223
func (f *Facility) SetLogger(log bark.Logger) {
	// Prevent changing the logger while a message is logged.
	f.mu.Lock()
	defer f.mu.Unlock()
	if log == nil {
		log = NoLogger
	}
	f.logger = log
}
1258649
func (cl *Listener) Handler(alpn string) (Handler, bool) {
	handler, ok := cl.handlers[alpn]
	return handler, ok
}
1181275
func (self *Manager) SetLoggerMaker(maker LoggerMaker) {
	self.lock.Lock()
	defer self.lock.Unlock()
	self.loggerMaker = maker
}
1287609
func SyslogNetHandler(net, addr string, priority syslog.Priority, tag string, fmtr Format) (Handler, error) {
	wr, err := syslog.Dial(net, addr, priority, tag)
	return sharedSyslog(fmtr, wr, err)
}
1256703
func (nc *Conn) SetErrorHandler(cb ErrHandler) {
	if nc == nil {
		return
	}
	nc.mu.Lock()
	defer nc.mu.Unlock()
	nc.Opts.AsyncErrorCB = cb
}
147740
func (l *logger) setDefaultMethodLogger(ml *methodLoggerConfig) error {
	if l.all != nil {
		return fmt.Errorf("conflicting global rules found")
	}
	l.all = ml
	return nil
}
726995
func (n *Node) SetLogger(l log.Logger) {
	n.logger = l
	n.em.SetLogger(l)
}
553516
func SetLogLevel(logLevel int) {
	gLogLevelBackup = gLogLevel
	switch logLevel {
	case LInfo:
		gLogLevel = logLevel
	case LDebug:
		gLogLevel = logLevel
	case LCritical:
		gLogLevel = logLevel
	case LError:
		gLogLevel = logLevel
	default:
		gLogLevel = LInfo
	}
}
953391
func (auto *AutoGcd) SetTerminationHandler(handler gcd.TerminatedHandler) {
	auto.debugger.SetTerminationHandler(handler)
}
738134
func (mc *multiProvider) SetLogger(logger log.Logger) {
	mc.logger = logger
	for _, p := range mc.providers {
		p.SetLogger(logger)
	}
}
113172
func SetWrapHandler(wh func(path string, handler http.Handler, err error) (string, http.Handler, error)) {
	wrapHandler = wh
}