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

Method IPPrefix

event.go:895–901  ·  view source on GitHub ↗

IPPrefix adds the field key with pfx as a net.IPNet IPv4 or IPv6 Prefix (address and mask) to the event

(key string, pfx net.IPNet)

Source from the content-addressed store, hash-verified

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 {
896 if e == nil {
897 return e
898 }
899 e.buf = enc.AppendIPPrefix(enc.AppendKey(e.buf, key), pfx)
900 return e
901}
902
903// IPPrefixes the field key with pfx as a net.IPNet array of IPv4 or IPv6 Prefixes (address and mask) to the event
904func (e *Event) IPPrefixes(key string, pfx []net.IPNet) *Event {

Callers 8

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

Calls 2

AppendIPPrefixMethod · 0.65
AppendKeyMethod · 0.65

Tested by 8

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