MCPcopy
hub / github.com/charmbracelet/log / TestLogContext_fields

Function TestLogContext_fields

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

Source from the content-addressed store, hash-verified

22}
23
24func TestLogContext_fields(t *testing.T) {
25 var buf bytes.Buffer
26 l := New(colorprofile.NewWriter(&buf, os.Environ()))
27 l.SetLevel(DebugLevel)
28 ctx := WithContext(context.Background(), l.With("foo", "bar"))
29 l = FromContext(ctx)
30 require.NotNil(t, l)
31 l.Debug("test")
32 require.Equal(t, "DEBU test foo=bar\n", buf.String())
33}

Callers

nothing calls this directly

Calls 7

NewFunction · 0.85
WithContextFunction · 0.85
FromContextFunction · 0.85
SetLevelMethod · 0.80
WithMethod · 0.80
DebugMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…