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

Function ExampleLogger_Trace

binary_test.go:103–114  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

101}
102
103func ExampleLogger_Trace() {
104 dst := bytes.Buffer{}
105 log := New(&dst)
106
107 log.Trace().
108 Str("foo", "bar").
109 Int("n", 123).
110 Msg("hello world")
111
112 fmt.Println(decodeIfBinaryToString(dst.Bytes()))
113 // Output: {"level":"trace","foo":"bar","n":123,"message":"hello world"}
114}
115
116func ExampleLogger_Debug() {
117 dst := bytes.Buffer{}

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected