logevent

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2016 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatWithEnv

func FormatWithEnv(text string) (result string)

FormatWithEnv format string with environment value, ex: %{HOSTNAME}

func FormatWithTime

func FormatWithTime(text string) (result string)

FormatWithTime format string with current time, ex: %{+2006-01-02}

Types

type LogEvent

type LogEvent struct {
	Timestamp time.Time              `json:"timestamp"`
	Message   string                 `json:"message"`
	Tags      []string               `json:"tags,omitempty"`
	Extra     map[string]interface{} `json:"-"`
}

LogEvent struct that is also the Based struct.

func (*LogEvent) AddTag

func (le *LogEvent) AddTag(tags ...string)

AddTag for LogEvent Tags

func (LogEvent) Format

func (le LogEvent) Format(format string) (out string)

Format return string with current time / LogEvent field / ENV, ex: %{hostname}

func (LogEvent) Get

func (le LogEvent) Get(field string) (v interface{})

Get Value form LogEvent'Key

func (LogEvent) GetString

func (le LogEvent) GetString(field string) (v string)

Get Value-String form LogEvent'Key

func (LogEvent) MarshalIndent

func (le LogEvent) MarshalIndent() (data []byte, err error)

Marshal LogEvent to Indent

func (LogEvent) MarshalJSON

func (le LogEvent) MarshalJSON() (data []byte, err error)

Marshal LogEvent to Json

Jump to

Keyboard shortcuts

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