MCPcopy
hub / github.com/uber-go/zap / AddCore

Method AddCore

zapcore/entry.go:298–305  ·  view source on GitHub ↗

AddCore adds a Core that has agreed to log this CheckedEntry. It's intended to be used by Core.Check implementations, and is safe to call on nil CheckedEntry references.

(ent Entry, core Core)

Source from the content-addressed store, hash-verified

296// used by Core.Check implementations, and is safe to call on nil CheckedEntry
297// references.
298func (ce *CheckedEntry) AddCore(ent Entry, core Core) *CheckedEntry {
299 if ce == nil {
300 ce = getCheckedEntry()
301 ce.Entry = ent
302 }
303 ce.cores = append(ce.cores, core)
304 return ce
305}
306
307// Should sets this CheckedEntry's CheckWriteAction, which controls whether a
308// Core will panic or fatal after writing this log entry. Like AddCore, it's

Callers 7

TestCheckedEntryBeforeFunction · 0.95
CheckMethod · 0.80
CheckMethod · 0.80
CheckMethod · 0.80
CheckMethod · 0.80
CheckMethod · 0.80
CheckMethod · 0.80

Calls 1

getCheckedEntryFunction · 0.85

Tested by 4

TestCheckedEntryBeforeFunction · 0.76
CheckMethod · 0.64
CheckMethod · 0.64
CheckMethod · 0.64