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

Function newEvent

event.go:68–79  ·  view source on GitHub ↗
(w LevelWriter, level Level, stack bool, ctx context.Context, hooks []Hook)

Source from the content-addressed store, hash-verified

66}
67
68func newEvent(w LevelWriter, level Level, stack bool, ctx context.Context, hooks []Hook) *Event {
69 e := eventPool.Get().(*Event)
70 e.buf = e.buf[:0]
71 e.stack = stack
72 e.ctx = ctx
73 e.ch = hooks
74 e.buf = enc.AppendBeginMarker(e.buf)
75 e.w = w
76 e.level = level
77 e.skipFrame = 0
78 return e
79}
80
81func (e *Event) write() (err error) {
82 if e == nil {

Callers 12

CreateDictMethod · 0.85
DictFunction · 0.85
appendObjectFunction · 0.85
TestEvent_AnErrFunction · 0.85
TestEvent_ObjectFunction · 0.85
TestEvent_MsgFuncFunction · 0.85
TestEvent_DoneHandlerFunction · 0.85
newEventMethod · 0.85
scratchEventMethod · 0.85
CreateDictMethod · 0.85

Calls 1

AppendBeginMarkerMethod · 0.65

Tested by 6

TestEvent_AnErrFunction · 0.68
TestEvent_ObjectFunction · 0.68
TestEvent_MsgFuncFunction · 0.68
TestEvent_DoneHandlerFunction · 0.68