MCPcopy
hub / github.com/rs/zerolog / TestMsgf

Function TestMsgf

log_test.go:711–718  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

709}
710
711func TestMsgf(t *testing.T) {
712 out := &bytes.Buffer{}
713 log := New(out)
714 log.Log().Msgf("one %s %.1f %d %v", "two", 3.4, 5, errors.New("six"))
715 if got, want := decodeIfBinaryToString(out.Bytes()), `{"message":"one two 3.4 5 six"}`+"\n"; got != want {
716 t.Errorf("invalid log output:\ngot: %v\nwant: %v", got, want)
717 }
718}
719
720func TestWithAndFieldsCombined(t *testing.T) {
721 out := &bytes.Buffer{}

Callers

nothing calls this directly

Calls 5

NewFunction · 0.85
MsgfMethod · 0.80
decodeIfBinaryToStringFunction · 0.70
LogMethod · 0.65
BytesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…