Function
newEvent
(w LevelWriter, level Level, stack bool, ctx context.Context, hooks []Hook)
Source from the content-addressed store, hash-verified
| 66 | } |
| 67 | |
| 68 | func 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 | |
| 81 | func (e *Event) write() (err error) { |
| 82 | if e == nil { |