MCPcopy Create free account
hub / github.com/belak/gitdir / TestCtxLogger

Function TestCtxLogger

context_test.go:134–146  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

132}
133
134func TestCtxLogger(t *testing.T) {
135 t.Parallel()
136
137 ctx := context.Background()
138
139 // Check the default value
140 assert.Equal(t, &log.Logger, CtxLogger(ctx))
141
142 // Check that when we set a value, this properly extracts it.
143 logger := log.With().Str("hello", "world").Logger()
144 ctx = context.WithValue(ctx, contextKeyLogger, &logger)
145 assert.Equal(t, &logger, CtxLogger(ctx))
146}
147
148func TestCtxSetPublicKey(t *testing.T) {
149 t.Skip("not implemented")

Callers

nothing calls this directly

Calls 1

CtxLoggerFunction · 0.85

Tested by

no test coverage detected