Documentation ¶
Overview ¶
Package internal provides helpers for concrete slog implementations
Index ¶
- func SortedKeys(fields map[string]any) []string
- type FieldsIterator
- type Loglet
- func (ll *Loglet) CallStack() core.Stack
- func (ll *Loglet) Fields() (iter *FieldsIterator)
- func (ll *Loglet) FieldsCount() int
- func (ll *Loglet) Level() slog.LogLevel
- func (ll *Loglet) WithField(label string, value any) Loglet
- func (ll *Loglet) WithFields(fields map[string]any) Loglet
- func (ll *Loglet) WithLevel(level slog.LogLevel) Loglet
- func (ll *Loglet) WithStack(skip int) Loglet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SortedKeys ¶
SortedKeys returns a sorted list of non-empty field keys
Types ¶
type FieldsIterator ¶
type FieldsIterator struct {
// contains filtered or unexported fields
}
FieldsIterator iterates over fields on a Log context
func (*FieldsIterator) Field ¶
func (iter *FieldsIterator) Field() (key string, value any)
Field returns key and value of the current field
func (*FieldsIterator) Key ¶
func (iter *FieldsIterator) Key() string
Key returns the label of the current field
func (*FieldsIterator) Next ¶
func (iter *FieldsIterator) Next() bool
Next advances iterator to next value. it returns false to indicate end of iteration, or true when the next (or first) field is ready to be accessed using Key(), Value(), or Field() when there are no new ones
func (*FieldsIterator) Value ¶
func (iter *FieldsIterator) Value() any
Value returns the value of the current field
type Loglet ¶
type Loglet struct {
// contains filtered or unexported fields
}
Loglet represents a link on the Logger context chain
func (*Loglet) Fields ¶
func (ll *Loglet) Fields() (iter *FieldsIterator)
Fields returns a FieldsIterator
func (*Loglet) FieldsCount ¶
FieldsCount return the number of fields on a Log context
func (*Loglet) WithFields ¶
WithFields attaches a set of fields to a new Loglet