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

Function ExampleEvent_Dur

log_example_test.go:351–362  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

349}
350
351func ExampleEvent_Dur() {
352 d := 10 * time.Second
353
354 log := zerolog.New(os.Stdout)
355
356 log.Log().
357 Str("foo", "bar").
358 Dur("dur", d).
359 Msg("hello world")
360
361 // Output: {"foo":"bar","dur":10000,"message":"hello world"}
362}
363
364func ExampleEvent_Durs() {
365 d := []time.Duration{

Callers

nothing calls this directly

Calls 5

NewFunction · 0.92
MsgMethod · 0.80
LogMethod · 0.65
DurMethod · 0.45
StrMethod · 0.45

Tested by

no test coverage detected