MCPcopy
hub / github.com/rs/zerolog / should

Method should

log.go:517–528  ·  view source on GitHub ↗

should returns true if the log event should be logged.

(lvl Level)

Source from the content-addressed store, hash-verified

515
516// should returns true if the log event should be logged.
517func (l *Logger) should(lvl Level) bool {
518 if l.disabled() {
519 return false
520 }
521 if lvl < l.level || lvl < GlobalLevel() {
522 return false
523 }
524 if l.sampler != nil && !samplingDisabled() {
525 return l.sampler.Sample(lvl)
526 }
527 return true
528}

Callers 1

newEventMethod · 0.95

Calls 4

disabledMethod · 0.95
GlobalLevelFunction · 0.85
samplingDisabledFunction · 0.85
SampleMethod · 0.65

Tested by

no test coverage detected