code: func (c *Command) setupLoggers(config *Config) (*GatedWriter, *logWriter, io.Writer) {
  	// Setup logging. First create the gated log writer, which will
  	// store logs until we're ready to show them. Then create the level
  	// filter, filtering logs of the specified level.
  	logGate := &GatedWriter{
  		Writer: &cli.UiWriter{Ui: c.Ui},
  	}
  
  	c.logFilter = LevelFilter()
  	c.logFilter.MinLevel = logutils.LogLevel(strings.ToUpper(config.LogLevel))
  	c.logFilter.Writer = logGate
  	if !ValidateLevelFilter(c.logFilter.MinLevel, c.logFilter) {
  		c.Ui.Error(fmt.Sprintf(
  			"Invalid log level: %s. Valid log levels are: %v",
  			c.logFilter.MinLevel, c.logFilter.Levels))
  		return nil, nil, nil
  	}
  
  	// Check if syslog is enabled
  	var syslog io.Writer
  	if config.EnableSyslog {
  		l, err := gsyslog.NewLogger(gsyslog.LOG_NOTICE, config.SyslogFacility, "serf")
  		if err != nil {
  			c.Ui.Error(fmt.Sprintf("Syslog setup failed: %v", err))
  			return nil, nil, nil
  		}
  		syslog = &SyslogWrapper{l, c.logFilter}
  	}
  
  	// Create a log writer, and wrap a logOutput around it
  	logWriter := NewLogWriter(512)
  	var logOutput io.Writer
  	if syslog != nil {
  		logOutput = io.MultiWriter(c.logFilter, logWriter, syslog)
  	} else {
  		logOutput = io.MultiWriter(c.logFilter, logWriter)
  	}
  
  	// Create a logger
  	c.logger = log.New(logOutput, "", log.LstdFlags)
  	return logGate, logWriter, logOutput
  }
docs: // setupLoggers is used to setup the logGate, logWriter, and our logOutput