Documentation ¶
Index ¶
- func FormatWithCurrentTime(text string) (result string)
- func FormatWithEnv(text string) (result string)
- func FormatWithEventTime(text string, evevtTime time.Time) (result string)
- type LogEvent
- func (t *LogEvent) AddTag(tags ...string)
- func (t LogEvent) Format(format string) (out string)
- func (t LogEvent) Get(field string) (v interface{})
- func (t LogEvent) GetString(field string) string
- func (t LogEvent) MarshalIndent() (data []byte, err error)
- func (t LogEvent) MarshalJSON() (data []byte, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatWithCurrentTime ¶
FormatWithCurrentTime format string with current time, ex: %{+2006-01-02}
func FormatWithEnv ¶
FormatWithEnv format string with environment value, ex: %{HOSTNAME}
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) Format ¶
Format return string with current time / LogEvent field / ENV, ex: %{hostname}
func (LogEvent) MarshalIndent ¶
func (LogEvent) MarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.