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

Method RawJSON

event.go:400–406  ·  view source on GitHub ↗

RawJSON adds already encoded JSON to the log line under key. No sanity check is performed on b; it must not contain carriage returns and be valid JSON.

(key string, b []byte)

Source from the content-addressed store, hash-verified

398// No sanity check is performed on b; it must not contain carriage returns and
399// be valid JSON.
400func (e *Event) RawJSON(key string, b []byte) *Event {
401 if e == nil {
402 return e
403 }
404 e.buf = appendJSON(enc.AppendKey(e.buf, key), b)
405 return e
406}
407
408// RawCBOR adds already encoded CBOR to the log line under key.
409//

Callers 4

TestEvent_WithNilEventFunction · 0.95
TestWithFunction · 0.45
TestFieldsFunction · 0.45
TestArrayFunction · 0.45

Calls 2

appendJSONFunction · 0.70
AppendKeyMethod · 0.65

Tested by 4

TestEvent_WithNilEventFunction · 0.76
TestWithFunction · 0.36
TestFieldsFunction · 0.36
TestArrayFunction · 0.36