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

Method write

event.go:81–94  ·  event.go::Event.write
()

Source from the content-addressed store, hash-verified

79}
80
81func (e *Event) write() (err error) {
82 if e == nil {
83 return nil
84 }
85 if e.level != Disabled {
86 e.buf = enc.AppendEndMarker(e.buf)
87 e.buf = enc.AppendLineBreak(e.buf)
88 if e.w != nil {
89 _, err = e.w.WriteLevel(e.level, e.buf)
90 }
91 }
92 putEvent(e)
93 return
94}
95
96// Enabled return false if the *Event is going to be filtered out by
97// log level or sampling.

Callers 8

msgMethod · 0.95
TestEvent_writeWithNilFunction · 0.95
TestEvent_WithNilEventFunction · 0.95
TestArrayFunction · 0.45
TestEvent_AnErrFunction · 0.45
TestEvent_ObjectFunction · 0.45
ArrayMethod · 0.45

Calls 4

putEventFunction · 0.85
AppendEndMarkerMethod · 0.65
AppendLineBreakMethod · 0.65
WriteLevelMethod · 0.65

Tested by 6

TestEvent_writeWithNilFunction · 0.76
TestEvent_WithNilEventFunction · 0.76
TestArrayFunction · 0.36
TestEvent_AnErrFunction · 0.36
TestEvent_ObjectFunction · 0.36