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

Function ExampleEvent_Durs

binary_test.go:363–379  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

361}
362
363func ExampleEvent_Durs() {
364 d := []time.Duration{
365 time.Duration(10 * time.Second),
366 time.Duration(20 * time.Second),
367 }
368
369 dst := bytes.Buffer{}
370 log := New(&dst)
371
372 log.Log().
373 Str("foo", "bar").
374 Durs("durs", d).
375 Msg("hello world")
376
377 fmt.Println(decodeIfBinaryToString(dst.Bytes()))
378 // Output: {"foo":"bar","durs":[10000,20000],"message":"hello world"}
379}
380
381func ExampleEvent_Fields_map() {
382 fields := map[string]interface{}{

Callers

nothing calls this directly

Calls 8

NewFunction · 0.85
MsgMethod · 0.80
PrintlnMethod · 0.80
decodeIfBinaryToStringFunction · 0.70
LogMethod · 0.65
DursMethod · 0.45
StrMethod · 0.45
BytesMethod · 0.45

Tested by

no test coverage detected