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

Function ExampleLogger_Error

binary_test.go:154–164  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

152}
153
154func ExampleLogger_Error() {
155 dst := bytes.Buffer{}
156 log := New(&dst)
157
158 log.Error().
159 Err(errors.New("some error")).
160 Msg("error doing something")
161
162 fmt.Println(decodeIfBinaryToString(dst.Bytes()))
163 // Output: {"level":"error","error":"some error","message":"error doing something"}
164}
165
166func ExampleLogger_WithLevel() {
167 dst := bytes.Buffer{}

Callers

nothing calls this directly

Calls 7

NewFunction · 0.85
MsgMethod · 0.80
PrintlnMethod · 0.80
decodeIfBinaryToStringFunction · 0.70
ErrMethod · 0.65
ErrorMethod · 0.45
BytesMethod · 0.45

Tested by

no test coverage detected