// should returns true if the log event should be logged.
198441
func (l *Logger) should(lvl Level) bool {
	if lvl < l.level || lvl < GlobalLevel() {
		return false
	}
	if l.sampler != nil && !samplingDisabled() {
		return l.sampler.Sample(lvl)
	}
	return true
}
39411
func (hd *HealthD) shouldStop() bool {
	v := atomic.LoadInt64(&hd.stopFlag)
	return v == 1
}
840593
func (l Logger) ShouldLog(path string) bool {
	for _, exc := range l.Exceptions {
		if Path(path).Matches(exc) {
			return false
		}
	}
	return true
}
626081
func (b *blockServerRemoteClientHandler) ShouldRetry(rpcName string, err error) bool {
	// Do not let connection.go's DoCommand retry any batch rpcs
	// since batchDowngradeReferences already handles retries.
	switch rpcName {
	case "keybase.1.block.delReferenceWithCount":
		return false
	case "keybase.1.block.archiveReferenceWithCount":
		return false
	}
	return kbfsblock.IsThrottleError(err)
}
1221227
func (self *TimedRotatingFileHandler) ShouldRollover(
	record *LogRecord) (bool, string) {

	overTime := time.Now().After(self.rolloverTime)
	return overTime, self.Format(record)
}
664631
func (c *Context) ShouldBindQuery(obj interface{}) error {
	return c.ShouldBindWith(obj, binding.Query)
}
152166
func (c *Context) ShouldBindXML(obj interface{}) error {
	return c.ShouldBindWith(obj, binding.XML)
}
133856
func ShouldNotify(oldStatus int, newStatus int) bool {
	log.Debugf("Checking event. OldStatus: %s NewStatus: %s",
		service.StatusString(oldStatus), service.StatusString(newStatus),
	)

	// Compare old and new states to find significant changes only
	switch newStatus {
	case service.ALIVE:
		return true
	case service.TOMBSTONE:
		return true
	case service.UNKNOWN:
		if oldStatus == service.ALIVE {
			return true
		}
	case service.UNHEALTHY:
		if oldStatus == service.ALIVE {
			return true
		}
	default:
		log.Errorf("Got unknown service change status: %d", newStatus)
		return false
	}

	log.Debugf("Skipped HAproxy update due to state machine check")
	return false
}
286988
func (p *CONNECT) will() bool {
	return len(p.willTopic) > 0 && len(p.willMessage) > 0
}
1368949
func Must(v *Version, err error) *Version {
	if err != nil {
		panic(err)
	}

	return v
}
1212174
func LogEvent(logger Logger, event *logutilpb.Event) {
	switch event.Level {
	case logutilpb.Level_INFO:
		logger.InfoDepth(1, EventString(event))
	case logutilpb.Level_WARNING:
		logger.WarningDepth(1, EventString(event))
	case logutilpb.Level_ERROR:
		logger.ErrorDepth(1, EventString(event))
	case logutilpb.Level_CONSOLE:
		// Note we can't just pass the string, because it might contain '%'.
		logger.Printf("%s", EventString(event))
	}
}
1038689
func (e ExtFilter) ShouldCompress(r *http.Request) bool {
	ext := path.Ext(r.URL.Path)
	return e.Exts.Contains(ExtWildCard) || e.Exts.Contains(ext)
}
327699
func Must(win *Window, err error) *Window {
	if err != nil {
		panic(err)
	}
	if win == nil {
		panic("win and err are nil")
	}
	return win
}
395584
func (a *Allocation) ShouldReschedule(reschedulePolicy *ReschedulePolicy, failTime time.Time) bool {
	// First check the desired state
	switch a.DesiredStatus {
	case AllocDesiredStatusStop, AllocDesiredStatusEvict:
		return false
	default:
	}
	switch a.ClientStatus {
	case AllocClientStatusFailed:
		return a.RescheduleEligible(reschedulePolicy, failTime)
	default:
		return false
	}
}
788674
func (f *Filter) shouldFieldPass(key string) bool {
	if f.fieldPass != nil && f.fieldDrop != nil {
		return f.fieldPass.Match(key) && !f.fieldDrop.Match(key)
	} else if f.fieldPass != nil {
		return f.fieldPass.Match(key)
	} else if f.fieldDrop != nil {
		return !f.fieldDrop.Match(key)
	}
	return true
}
802817
func ShouldCreate(ctx context.Context, g *libkb.GlobalContext) (res ShouldCreateResult, err error) {
	mctx := libkb.NewMetaContext(ctx, g)
	defer mctx.TraceTimed("Stellar.ShouldCreate", func() error { return err })()
	defer func() {
		mctx.Debug("Stellar.ShouldCreate: (res:%+v, err:%v)", res, err != nil)
	}()
	arg := libkb.NewAPIArg("stellar/shouldcreate")
	arg.RetryCount = 3
	arg.SessionType = libkb.APISessionTypeREQUIRED
	var apiRes shouldCreateRes
	err = mctx.G().API.GetDecode(mctx, arg, &apiRes)
	return apiRes.ShouldCreateResult, err
}
1358785
func (c *config) log(event Event, err error, args ...interface{}) {
	if c.lfunc != nil {
		c.lfunc(event, err, args...)
	}
}