func NewWriter(config GELFConfig) (GELFWriter, error) {

	// handle config
	if config.Host == "" {
		return nil, fmt.Errorf("missing host")
	}

	if config.ChunkSize == 0 {
		config.ChunkSize = DefaultChunkSize
	}

	if config.CompressionLevel == 0 {
		config.CompressionLevel = flate.BestSpeed
	}

	var err error
	if hostname, err = os.Hostname(); err != nil {
		panic(err)
	}

	// handle http / udp writing method
	if strings.HasPrefix(config.Host, "http") {
		return newHTTPWriter(&config)
	}

	return newUDPWriter(&config)
}
// NewWriter returns a new GELFWriter. This writer can be used to send the
// output of the standard Go log functions to a central GELF server by
// passing it to log.SetOutput()
NewWriter returns a new GELFWriter. This writer can be used to send the
output of the standard Go log functions to a central GELF server by
passing it to log.SetOutput()
// NewWriter returns a new GELFWriter . This writer can be used to send the // output of the standard Go log functions to a central GELF server by // passing it to log . SetOutput ()
func NewWriter(config GELFConfig) (GELFWriter, error) {
	if config.Host == "" {
		return nil, fmt.Errorf("missing host")
	}
	if config.ChunkSize == 0 {
		config.ChunkSize = DefaultChunkSize
	}
	if config.CompressionLevel == 0 {
		config.CompressionLevel = flate.BestSpeed
	}
	var err error
	if hostname, err = os.Hostname(); err != nil {
		panic(err)
	}
	if strings.HasPrefix(config.Host, "http") {
		return newHTTPWriter(&config)
	}
	return newUDPWriter(&config)
}
func NewWriter ( config GELFConfig ) ( GELFWriter , error ) { if config . Host == " " { return nil , fmt . Errorf ( " " ) } if config . ChunkSize == 0 { config . ChunkSize = DefaultChunkSize } if config . CompressionLevel == 0 { config . CompressionLevel = flate . BestSpeed } var err error if hostname , err = os . Hostname ( ) ; err != nil { panic ( err ) } if strings . HasPrefix ( config . Host , " " ) { return newHTTPWriter ( & config ) } return newUDPWriter ( & config ) }
NewWriter returns a new GELFWriter.
NewWriter returns a new GELFWriter .
// handle config // handle http / udp writing method