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

Method Len

zaptest/observer/observer.go:43–48  ·  view source on GitHub ↗

Len returns the number of items in the collection.

()

Source from the content-addressed store, hash-verified

41
42// Len returns the number of items in the collection.
43func (o *ObservedLogs) Len() int {
44 o.mu.RLock()
45 n := len(o.logs)
46 o.mu.RUnlock()
47 return n
48}
49
50// All returns a copy of all the observed logs.
51func (o *ObservedLogs) All() []LoggedEntry {

Callers 15

TestWriterFunction · 0.45
TestWrite_SyncFunction · 0.45
writeLineMethod · 0.45
flushMethod · 0.45
AppendDurationMethod · 0.45
AppendTimeMethod · 0.45
EncodeEntryMethod · 0.45
addElementSeparatorMethod · 0.45
TestCheckedEntryBeforeFunction · 0.45
TestHooksFunction · 0.45
zapEncodeFunction · 0.45
writeContextMethod · 0.45

Calls

no outgoing calls

Tested by 9

TestWriterFunction · 0.36
TestWrite_SyncFunction · 0.36
TestCheckedEntryBeforeFunction · 0.36
TestHooksFunction · 0.36
zapEncodeFunction · 0.36
assertEmptyFunction · 0.36
TestObserverFunction · 0.36
TestLoggerV2Function · 0.36