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

Method Bytes

event.go:379–385  ·  event.go::Event.Bytes

Bytes adds the field key with val as a string to the *Event context. Runes outside of normal ASCII ranges will be hex-encoded in the resulting JSON.

(key string, val []byte)

Source from the content-addressed store, hash-verified

377// Runes outside of normal ASCII ranges will be hex-encoded in the resulting
378// JSON.
379func (e *Event) Bytes(key string, val []byte) *Event {
380 if e == nil {
381 return e
382 }
383 e.buf = enc.AppendBytes(enc.AppendKey(e.buf, key), val)
384 return e
385}
386
387// Hex adds the field key with val as a hex string to the *Event context.
388func (e *Event) Hex(key string, val []byte) *Event {

Callers 15

TestLogFunction · 0.45
TestInfoFunction · 0.45
TestEmptyLevelFieldNameFunction · 0.45
TestWithFunction · 0.45
TestStackedWithsFunction · 0.45
TestWithPluralsFunction · 0.45
TestWithResetFunction · 0.45
TestFieldsMapFunction · 0.45
TestFieldsMap_ArraysFunction · 0.45
TestWithErrFunction · 0.45
TestFieldsErrFunction · 0.45
TestFieldsErrsFunction · 0.45

Calls 2

AppendBytesMethod · 0.65
AppendKeyMethod · 0.65

Tested by 15

TestLogFunction · 0.36
TestInfoFunction · 0.36
TestEmptyLevelFieldNameFunction · 0.36
TestWithFunction · 0.36
TestStackedWithsFunction · 0.36
TestWithPluralsFunction · 0.36
TestWithResetFunction · 0.36
TestFieldsMapFunction · 0.36
TestFieldsMap_ArraysFunction · 0.36
TestWithErrFunction · 0.36
TestFieldsErrFunction · 0.36
TestFieldsErrsFunction · 0.36