Documentation ¶
Overview ¶
Package logs implements functions to manipulate logs.
Logs created are taggable.
logs.WithTags := logs.New("a log with tags"). WithTag("a", 42). WithTag("b", 21)
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // The function used to encode log entries and their tags. Encoder func(any) ([]byte, error) )
Functions ¶
func SetIndentEncoder ¶
func SetIndentEncoder()
SetIndentEncoder is a helper function that set the logs encoder to a function that uses json.MarshalIndent.
func SetInlineEncoder ¶
func SetInlineEncoder()
SetInlineEncoder is a helper function that set the logs encoder to json.Marshal.
Types ¶
type Entry ¶
type Entry struct { Line string `json:"line,omitempty"` Message string `json:"message"` Tags map[string]any `json:"tags,omitempty"` }
A log entry.
Click to show internal directories.
Click to hide internal directories.