fluent

package
v0.4.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2014 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const Version = "0.4.3"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	FluentPort  int
	FluentHost  string
	Timeout     time.Duration
	BufferLimit int
	RetryWait   int
	MaxRetry    int
}

type Fluent

type Fluent struct {
	Config
	// contains filtered or unexported fields
}

func New

func New(config Config) (f *Fluent, err error)

New creates a new Logger.

func (*Fluent) Close

func (f *Fluent) Close() (err error)

Close closes the connection.

func (*Fluent) Post

func (f *Fluent) Post(tag string, message interface{})

Post writes the output for a logging event.

Examples:

// send string
f.Post("tag_name", "data")

// send map[string]
mapStringData := map[string]string{
	"foo":  "bar",
}
f.Post("tag_name", mapStringData)

// send message with specified time
mapStringData := map[string]string{
	"foo":  "bar",
}
tm := time.Now()
f.PostWithTime("tag_name", tm, mapStringData)

// send struct
structData := struct {
		Name string `codec:"name"`
} {
		"john smith",
}
f.Post("tag_name", structData)

func (*Fluent) PostWithTime added in v0.4.3

func (f *Fluent) PostWithTime(tag string, tm time.Time, message interface{})

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL