code: func New(config Config) (f *Fluent, err error) {
  	if config.FluentNetwork == "" {
  		config.FluentNetwork = defaultNetwork
  	}
  	if config.FluentHost == "" {
  		config.FluentHost = defaultHost
  	}
  	if config.FluentPort == 0 {
  		config.FluentPort = defaultPort
  	}
  	if config.FluentSocketPath == "" {
  		config.FluentSocketPath = defaultSocketPath
  	}
  	if config.Timeout == 0 {
  		config.Timeout = defaultTimeout
  	}
  	if config.WriteTimeout == 0 {
  		config.WriteTimeout = defaultWriteTimeout
  	}
  	if config.BufferLimit == 0 {
  		config.BufferLimit = defaultBufferLimit
  	}
  	if config.RetryWait == 0 {
  		config.RetryWait = defaultRetryWait
  	}
  	if config.MaxRetry == 0 {
  		config.MaxRetry = defaultMaxRetry
  	}
  	if config.MaxRetryWait == 0 {
  		config.MaxRetryWait = defaultMaxRetryWait
  	}
  	if config.AsyncConnect {
  		fmt.Fprintf(os.Stderr, "fluent#New: AsyncConnect is now deprecated, please use Async instead")
  		config.Async = config.Async || config.AsyncConnect
  	}
  	if config.Async {
  		f = &Fluent{
  			Config:  config,
  			pending: make(chan *msgToSend, config.BufferLimit),
  		}
  		f.wg.Add(1)
  		go f.run()
  	} else {
  		f = &Fluent{Config: config}
  		err = f.connect()
  	}
  	return
  }
docs: // New creates a new Logger.