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

Method IPAddrs

event.go:886–892  ·  view source on GitHub ↗

IPAddrs adds the field key with ip as a net.IP array of IPv4 or IPv6 Address to the event

(key string, ip []net.IP)

Source from the content-addressed store, hash-verified

884
885// IPAddrs adds the field key with ip as a net.IP array of IPv4 or IPv6 Address to the event
886func (e *Event) IPAddrs(key string, ip []net.IP) *Event {
887 if e == nil {
888 return e
889 }
890 e.buf = enc.AppendIPAddrs(enc.AppendKey(e.buf, key), ip)
891 return e
892}
893
894// IPPrefix adds the field key with pfx as a net.IPNet IPv4 or IPv6 Prefix (address and mask) to the event
895func (e *Event) IPPrefix(key string, pfx net.IPNet) *Event {

Callers 8

TestEvent_WithNilEventFunction · 0.95
ExampleContext_IPAddrsFunction · 0.45
TestFieldsArrayNilFunction · 0.45
TestFieldsArrayEmptyFunction · 0.45
BenchmarkLogFieldTypeFunction · 0.45

Calls 2

AppendKeyMethod · 0.65
AppendIPAddrsMethod · 0.45

Tested by 8

TestEvent_WithNilEventFunction · 0.76
ExampleContext_IPAddrsFunction · 0.36
TestFieldsArrayNilFunction · 0.36
TestFieldsArrayEmptyFunction · 0.36
BenchmarkLogFieldTypeFunction · 0.36