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

Function ExampleLogger_Warn

binary_test.go:142–152  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

140}
141
142func ExampleLogger_Warn() {
143 dst := bytes.Buffer{}
144 log := New(&dst)
145
146 log.Warn().
147 Str("foo", "bar").
148 Msg("a warning message")
149
150 fmt.Println(decodeIfBinaryToString(dst.Bytes()))
151 // Output: {"level":"warn","foo":"bar","message":"a warning message"}
152}
153
154func ExampleLogger_Error() {
155 dst := bytes.Buffer{}

Callers

nothing calls this directly

Calls 7

NewFunction · 0.85
MsgMethod · 0.80
WarnMethod · 0.80
PrintlnMethod · 0.80
decodeIfBinaryToStringFunction · 0.70
StrMethod · 0.45
BytesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…