// Set the application log and handler, if handler is nil it will
// use the same handler used to configure the application log before
168449
func setAppLog(appLog logger.MultiLogger, appHandler *logger.CompositeMultiHandler) {
	if appLog != nil {
		AppLog = appLog
	}
	if appHandler != nil {
		appLogHandler = appHandler
		// Set the app log and the handler for all forked loggers
		RootLog.SetHandler(appLogHandler)

		// Set the system log handler - this sets golang writer stream to the
		// sysLog router
		logger.SetDefaultLog(SysLog)
		SysLog.SetStackDepth(5)
		SysLog.SetHandler(appLogHandler)
	}
}
689773
func (h *Handler) HandleLog(e *log.Entry) error {
	for _, handler := range h.Handlers {
		// TODO(tj): maybe just write to stderr here, definitely not ideal
		// to miss out logging to a more critical handler if something
		// goes wrong
		if err := handler.HandleLog(e); err != nil {
			return err
		}
	}

	return nil
}
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
}
1075651
func SetLogFile(path string) error {
	file, err := os.OpenFile(path, os.O_RDWR|os.O_APPEND|os.O_CREATE, 0666)
	if err != nil {
		return err
	}
	LogHandle = file
	initialize()
	return nil
}
771240
func (s *ServerEvent) SetLogUrl(v string) *ServerEvent {
	s.LogUrl = &v
	return s
}
1360862
func (h *Handler) HandleLog(e *log.Entry) error {
	h.entries <- e
	return nil
}
1318992
func SetLogLevel(logLevel string) {
	if logLevel != "" {
		lvl, err := logrus.ParseLevel(logLevel)
		if err != nil {
			fmt.Fprintf(os.Stderr, "Unable to parse logging level: %s\n", logLevel)
			os.Exit(1)
		}
		logrus.SetLevel(lvl)
	} else {
		logrus.SetLevel(logrus.InfoLevel)
	}
}
728211
func (lgr *logger) SetLogger(l genericLogger) {
	lgr.mutex.Lock()
	defer lgr.mutex.Unlock()

	lgr.Logger = l
}
1282322
func (m *MMClient) SetLogLevel(level string) {
	l, err := logrus.ParseLevel(level)
	if err != nil {
		m.logger.Warnf("Failed to parse specified log-level '%s': %#v", level, err)
	} else {
		m.rootLogger.SetLevel(l)
	}
}
707348
func SetLogger(logger Logger) {
	globalLock.Lock()
	defer globalLock.Unlock()
	if globalLevelSet {
		logger = logger.AtLevel(globalLevel)
	}
	globalLogger = logger
}
214923
func SetAppInfo(info *AppInfo) {
	if info != nil && info.Name == "" {
		panic(fmt.Errorf("App info name cannot be empty"))
	}
	appInfo = info

	// This is run in init, but we need to reinitialize it now that we have
	// some app info.
	initUserAgent()
}
564028
func LogRoute(a *app.App, handler http.Handler) http.Handler {
	return LogAdapter{
		app:     a,
		handler: handler,
	}
}
167811
func (r *Runtime) SetLogger(logger logger.Logger) {
	r.logger = logger
	middleware.Logger = logger
}
859461
func (a *App) Init(app string, handler AppInstanceHandler) {
	a.Events = InitConsumer(app)
	go func(app string, a *App) {
		for event := range a.Events {
			var as AppStart
			json.Unmarshal(event, &as)
			if as.Application == app {
				ai := new(AppInstance)
				ai.InitAppInstance(as.DialogID)
				go handler(ai)
			}
		}
	}(app, a)
}
1181275
func (self *Manager) SetLoggerMaker(maker LoggerMaker) {
	self.lock.Lock()
	defer self.lock.Unlock()
	self.loggerMaker = maker
}
349332
func (b *Base) SetErrorHandler(eh ErrorHandler) error {
	if eh == nil {
		return errors.New("error handler must be non-nil")
	}

	b.mutex.Lock()
	defer b.mutex.Unlock()
	b.errHandler = eh

	return nil
}
1047902
func (handler *handler) Handle(_ <-chan struct{}, applications []string) error {
	return handler.config.Facade.Rescale(applications)
}