MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / NewContext

Function NewContext

pkg/log/context.go:24–26  ·  view source on GitHub ↗

NewContext returns a derived context with the logger set.

(ctx context.Context, logger Interface)

Source from the content-addressed store, hash-verified

22
23// NewContext returns a derived context with the logger set.
24func NewContext(ctx context.Context, logger Interface) context.Context {
25 return context.WithValue(ctx, loggerKey, logger)
26}
27
28// NewContextWithField returns a derived context with the given field added to the logger.
29func NewContextWithField(ctx context.Context, k string, v any) context.Context {

Callers 15

TestNewRPCServerFunction · 0.92
TestSendGridFunction · 0.92
TestSMTPFunction · 0.92
TestBatchOperationsFunction · 0.92
TestTLSCertVerificationFunction · 0.92

Calls

no outgoing calls

Tested by 15

TestNewRPCServerFunction · 0.74
TestSendGridFunction · 0.74
TestSMTPFunction · 0.74
TestBatchOperationsFunction · 0.74
TestTLSCertVerificationFunction · 0.74