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

Function ExampleLogger_Info

binary_test.go:129–140  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

127}
128
129func ExampleLogger_Info() {
130 dst := bytes.Buffer{}
131 log := New(&dst)
132
133 log.Info().
134 Str("foo", "bar").
135 Int("n", 123).
136 Msg("hello world")
137
138 fmt.Println(decodeIfBinaryToString(dst.Bytes()))
139 // Output: {"level":"info","foo":"bar","n":123,"message":"hello world"}
140}
141
142func ExampleLogger_Warn() {
143 dst := bytes.Buffer{}

Callers

nothing calls this directly

Calls 8

NewFunction · 0.85
MsgMethod · 0.80
PrintlnMethod · 0.80
decodeIfBinaryToStringFunction · 0.70
InfoMethod · 0.65
IntMethod · 0.45
StrMethod · 0.45
BytesMethod · 0.45

Tested by

no test coverage detected