(t *testing.T)
| 22 | } |
| 23 | |
| 24 | func 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 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…