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

Method AllUntimed

zaptest/observer/observer.go:72–78  ·  view source on GitHub ↗

AllUntimed returns a copy of all the observed logs, but overwrites the observed timestamps with time.Time's zero value. This is useful when making assertions in tests.

()

Source from the content-addressed store, hash-verified

70// observed timestamps with time.Time's zero value. This is useful when making
71// assertions in tests.
72func (o *ObservedLogs) AllUntimed() []LoggedEntry {
73 ret := o.All()
74 for i := range ret {
75 ret[i].Time = time.Time{}
76 }
77 return ret
78}
79
80// FilterLevelExact filters entries to those logged at exactly the given level.
81func (o *ObservedLogs) FilterLevelExact(level zapcore.Level) *ObservedLogs {

Callers 15

TestReplaceGlobalsFunction · 0.80
TestRedirectStdLogFunction · 0.80
TestRedirectStdLogAtFunction · 0.80
checkStdLogMessageFunction · 0.80
TestIncreaseLevelFunction · 0.80
TestSugarWithFunction · 0.80
TestSugarLnLoggingFunction · 0.80

Calls 1

AllMethod · 0.95

Tested by 15

TestReplaceGlobalsFunction · 0.64
TestRedirectStdLogFunction · 0.64
TestRedirectStdLogAtFunction · 0.64
checkStdLogMessageFunction · 0.64
TestIncreaseLevelFunction · 0.64
TestSugarWithFunction · 0.64
TestSugarLnLoggingFunction · 0.64