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

Function ExampleLogger_Debug

binary_test.go:116–127  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

114}
115
116func ExampleLogger_Debug() {
117 dst := bytes.Buffer{}
118 log := New(&dst)
119
120 log.Debug().
121 Str("foo", "bar").
122 Int("n", 123).
123 Msg("hello world")
124
125 fmt.Println(decodeIfBinaryToString(dst.Bytes()))
126 // Output: {"level":"debug","foo":"bar","n":123,"message":"hello world"}
127}
128
129func ExampleLogger_Info() {
130 dst := bytes.Buffer{}

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected