MCPcopy Create free account
hub / github.com/coder/slog / With

Method With

slog.go:131–134  ·  view source on GitHub ↗

With returns a Logger that prepends the given fields on every logged entry. It will append to any fields already in the Logger.

(fields ...Field)

Source from the content-addressed store, hash-verified

129//
130// It will append to any fields already in the Logger.
131func (l Logger) With(fields ...Field) Logger {
132 l.fields = l.fields.append(fields)
133 return l
134}
135
136// Named appends the name to the set names
137// on the logger.

Callers 4

TestStdlibFunction · 0.80
TestLoggerFunction · 0.80
ExampleWithFunction · 0.80
ExampleStdlibFunction · 0.80

Calls 1

appendMethod · 0.80

Tested by 4

TestStdlibFunction · 0.64
TestLoggerFunction · 0.64
ExampleWithFunction · 0.64
ExampleStdlibFunction · 0.64