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

Method IPAddr

event.go:877–883  ·  view source on GitHub ↗

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

(key string, ip net.IP)

Source from the content-addressed store, hash-verified

875
876// IPAddr adds the field key with ip as a net.IP IPv4 or IPv6 Address to the event
877func (e *Event) IPAddr(key string, ip net.IP) *Event {
878 if e == nil {
879 return e
880 }
881 e.buf = enc.AppendIPAddr(enc.AppendKey(e.buf, key), ip)
882 return e
883}
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 {

Callers 8

TestEvent_WithNilEventFunction · 0.95
ExampleContext_IPAddrFunction · 0.45
TestFieldsFunction · 0.45
TestFieldsDisabledFunction · 0.45
TestArrayFunction · 0.45
ExampleContext_IPAddrFunction · 0.45
BenchmarkLogFieldTypeFunction · 0.45

Calls 2

AppendIPAddrMethod · 0.65
AppendKeyMethod · 0.65

Tested by 8

TestEvent_WithNilEventFunction · 0.76
ExampleContext_IPAddrFunction · 0.36
TestFieldsFunction · 0.36
TestFieldsDisabledFunction · 0.36
TestArrayFunction · 0.36
ExampleContext_IPAddrFunction · 0.36
BenchmarkLogFieldTypeFunction · 0.36