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

Method CreateArray

context.go:49–55  ·  view source on GitHub ↗

CreateArray creates an Array to be used with the Context.Array method. It preserves the stack, hooks, and context from the logger. Call usual field methods like Str, Int etc to add elements to this array and give it as argument the Context.Array method.

()

Source from the content-addressed store, hash-verified

47// Call usual field methods like Str, Int etc to add elements to this
48// array and give it as argument the Context.Array method.
49func (c Context) CreateArray() *Array {
50 a := Arr()
51 a.stack = c.l.stack
52 a.ctx = c.l.ctx
53 a.ch = c.l.hooks
54 return a
55}
56
57// Array adds the field key with an array to the event context.
58// Use c.CreateArray() to create the array or pass a type that

Callers 2

ArrayMethod · 0.95
ErrsMethod · 0.95

Calls 1

ArrFunction · 0.85

Tested by

no test coverage detected