logevent

package
v0.0.0-...-7697303 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2017 License: LGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatWithCurrentTime

func FormatWithCurrentTime(text string) (result string)

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

func FormatWithEnv

func FormatWithEnv(text string) (result string)

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

func FormatWithEventTime

func FormatWithEventTime(text string, evevtTime time.Time) (result string)

FormatWithEventTime format string with event 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:"-"`
}

func (*LogEvent) AddTag

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

func (LogEvent) Format

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

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

func (LogEvent) Get

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

func (LogEvent) GetString

func (t LogEvent) GetString(field string) string

func (LogEvent) MarshalIndent

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

func (LogEvent) MarshalJSON

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

Jump to

Keyboard shortcuts

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