Documentation
¶
Index ¶
Constants ¶
const AttrGroupDelimiter = ">"
Variables ¶
This section is empty.
Functions ¶
func GroupAttrsRecursive ¶
GroupAttrsRecursive takes a list of attributes, and for each attribute that has a key that contains the group delimiter, it will be split into a nested group, replacing all of the original attributes with the same nested group.
Example:
- keys: ["foo>bar>baz", "foo>bar>qux", "foo>baz>qux", "abc"]
- effective result: [{"foo": {"bar": {"baz": "value", "qux": "value"}, "baz": {"qux": "value"}}, "abc": "value"}]
Types ¶
type Discard ¶
type Discard struct{}
Discard is a log/slog.Handler that discards all log records.
func (*Discard) Enabled ¶
Enabled implements the log/slog.Handler interface.
func (*Discard) Handle ¶
Handle implements the log/slog.Handler interface.
func (*Discard) WithAttrs ¶
WithAttrs implements the log/slog.Handler interface.
type LimitedBuffer ¶
LimitedBuffer is a buffer that limits the amount of bytes writeable to it. It is designed to be used for logging purposes, so the exact bytes may be exceeded, as a truncated message will be appended after the limit is reached. It will silently drop any additional bytes once the limit is reached. If the max bytes is <= 0, no limit will be applied, and the buffer will behave normally.
func NewLimitedBuffer ¶
func NewLimitedBuffer(maxSize int) *LimitedBuffer
NewLimitedBuffer creates a new LimitedBuffer with the given maximum size.
func (*LimitedBuffer) Reset ¶
func (b *LimitedBuffer) Reset()