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

Function NewSampler

zapcore/sampler.go:195–197  ·  view source on GitHub ↗

NewSampler creates a Core that samples incoming entries, which caps the CPU and I/O load of logging while attempting to preserve a representative subset of your logs. Zap samples by logging the first N entries with a given level and message each tick. If more Entries with the same level and message

(core Core, tick time.Duration, first, thereafter int)

Source from the content-addressed store, hash-verified

193//
194// Deprecated: use NewSamplerWithOptions.
195func NewSampler(core Core, tick time.Duration, first, thereafter int) Core {
196 return NewSamplerWithOptions(core, tick, first, thereafter)
197}
198
199func (s *sampler) Level() Level {
200 return LevelOf(s.Core)

Callers 1

fakeSamplerFunction · 0.85

Calls 1

NewSamplerWithOptionsFunction · 0.85

Tested by 1

fakeSamplerFunction · 0.68