MCPcopy
hub / github.com/unkeyed/unkey / Add

Method Add

pkg/logger/event.go:34–38  ·  view source on GitHub ↗

Add appends attributes to the event. These attributes will be included in the log entry when [End] is called. Prefer using the context-based [Set] function when possible, as it doesn't require passing the event directly.

(attrs ...slog.Attr)

Source from the content-addressed store, hash-verified

32// in the log entry when [End] is called. Prefer using the context-based
33// [Set] function when possible, as it doesn't require passing the event directly.
34func (e *Event) Add(attrs ...slog.Attr) {
35 e.mu.Lock()
36 defer e.mu.Unlock()
37 e.attrs = append(e.attrs, attrs...)
38}
39
40// Set is an alias for [Event.Add], provided for consistency with the
41// package-level [Set] function.

Callers 15

SetMethod · 0.95
SetNullMethod · 0.45
SetNullManyMethod · 0.45
SetMethod · 0.45
SetManyMethod · 0.45
revalidateManyMethod · 0.45
NewFunction · 0.45
preflightMethod · 0.45
IncrementMethod · 0.45
DecrementMethod · 0.45
SetIfNotExistsMethod · 0.45

Calls 1

LockMethod · 0.80

Tested by 15

TestRedisCounterFunction · 0.36
TestRedisCounterMultiGetFunction · 0.36
FuzzRedactFunction · 0.36
generateTestCertificateFunction · 0.36
generateTestCertificateFunction · 0.36
TestTestClockFunction · 0.36