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

Method Int

event.go:536–542  ·  view source on GitHub ↗

Int adds the field key with i as a int to the *Event context.

(key string, i int)

Source from the content-addressed store, hash-verified

534
535// Int adds the field key with i as a int to the *Event context.
536func (e *Event) Int(key string, i int) *Event {
537 if e == nil {
538 return e
539 }
540 e.buf = enc.AppendInt(enc.AppendKey(e.buf, key), i)
541 return e
542}
543
544// Ints adds the field key with i as a []int to the *Event context.
545func (e *Event) Ints(key string, i []int) *Event {

Callers 15

TestEvent_WithNilEventFunction · 0.95
ExampleLogger_TraceFunction · 0.45
ExampleLogger_DebugFunction · 0.45
ExampleLogger_InfoFunction · 0.45
ExampleEvent_DictFunction · 0.45
MarshalZerologObjectMethod · 0.45
ExampleEvent_ArrayFunction · 0.45
ExampleContext_DictFunction · 0.45
ExampleContext_ArrayFunction · 0.45
TestLogFunction · 0.45
TestInfoFunction · 0.45
TestEmptyLevelFieldNameFunction · 0.45

Calls 2

AppendIntMethod · 0.65
AppendKeyMethod · 0.65

Tested by 15

TestEvent_WithNilEventFunction · 0.76
ExampleLogger_TraceFunction · 0.36
ExampleLogger_DebugFunction · 0.36
ExampleLogger_InfoFunction · 0.36
ExampleEvent_DictFunction · 0.36
MarshalZerologObjectMethod · 0.36
ExampleEvent_ArrayFunction · 0.36
ExampleContext_DictFunction · 0.36
ExampleContext_ArrayFunction · 0.36
TestLogFunction · 0.36
TestInfoFunction · 0.36
TestEmptyLevelFieldNameFunction · 0.36