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