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

Function ExampleEvent_Fields_slice

log_example_test.go:396–410  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

394}
395
396func ExampleEvent_Fields_slice() {
397 fields := []interface{}{
398 "bar", "baz",
399 "n", 1,
400 }
401
402 log := zerolog.New(os.Stdout)
403
404 log.Log().
405 Str("foo", "bar").
406 Fields(fields).
407 Msg("hello world")
408
409 // Output: {"foo":"bar","bar":"baz","n":1,"message":"hello world"}
410}
411
412func ExampleContext_Dict() {
413 ctx := zerolog.New(os.Stdout).With().

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected