// LogErrCount is a helper method used primarily for test validation
13363
func (c *Client) LogErrCount() int {
	c.Lock()
	defer c.Unlock()
	return len(c.ErrLog)
}
740786
func (l DebugListener) OnCount(name string, enabled bool) {
	fmt.Printf("Counted '%s'  as enabled? %v\n", name, enabled)
}
1067247
func (h *HyperLogLog) Count() uint64 {
	est := calculateEstimate(h.reg)
	if est <= float64(h.m)*2.5 {
		if v := countZeros(h.reg); v != 0 {
			return uint64(linearCounting(h.m, v))
		}
		return uint64(est)
	} else if est < two32/30 {
		return uint64(est)
	}
	return uint64(-two32 * math.Log(1-est/two32))
}
1245461
func (table *RegommendTable) log(v ...interface{}) {
	if table.logger == nil {
		return
	}

	table.logger.Println(v...)
}
1276956
func (r *responseStats) log() {
	var avg time.Duration
	if r.count != 0 {
		avg = r.sumDuration / time.Duration(r.count)
	} else {
		avg = 0
	}
	logrus.WithFields(logrus.Fields{
		"count":            r.count,
		"lifetime_count":   r.totalCount + r.count,
		"slowest":          r.maxDuration,
		"fastest":          r.minDuration,
		"avg_duration":     avg,
		"count_per_status": r.statusCodes,
		"response_bodies":  r.bodies,
		"errors":           r.errors,
	}).Info("Summary of sent events")
	if r.event != nil {
		fields := make(map[string]interface{})
		fields["event"] = r.event.Data
		fields["event_timestamp"] = r.event.Timestamp
		logrus.WithFields(fields).Info("Last parsed event")
	}
}
657432
func LoggerMiddleware(rw ResponseWriter, req *Request, next NextMiddlewareFunc) {
	startTime := time.Now()

	next(rw, req)

	duration := time.Since(startTime).Nanoseconds()
	var durationUnits string
	switch {
	case duration > 2000000:
		durationUnits = "ms"
		duration /= 1000000
	case duration > 1000:
		durationUnits = "μs"
		duration /= 1000
	default:
		durationUnits = "ns"
	}

	Logger.Printf("[%d %s] %d '%s'\n", duration, durationUnits, rw.StatusCode(), req.URL.Path)
}
811114
func (a *assertion) Logf(format string, args ...interface{}) {
	a.failer.Logf(format, args...)
}
566688
func (sc *StatementContext) WarningCount() uint16 {
	if sc.InShowWarning {
		return 0
	}
	sc.mu.Lock()
	wc := uint16(len(sc.mu.warnings))
	sc.mu.Unlock()
	return wc
}
578704
func (u *UpdateJob) InstanceCount(inst int32) *UpdateJob {
	u.req.InstanceCount = inst
	return u
}
322268
func (m *Miniredis) CommandCount() int {
	m.Lock()
	defer m.Unlock()
	return int(m.srv.TotalCommands())
}
58256
func checkErr(err error, handleErr func(string, int)) {
	switch err.(type) {
	case nil:
		return
	case preflightError:
		handleErr(err.Error(), PreFlightExitCode)
	case errorsutil.Aggregate:
		handleErr(err.Error(), ValidationExitCode)

	default:
		handleErr(err.Error(), DefaultErrorExitCode)
	}
}
528737
func (e *Store) startObservingCount(period time.Duration) func() {
	prefix := e.KeyRootFunc(genericapirequest.NewContext())
	resourceName := e.DefaultQualifiedResource.String()
	klog.V(2).Infof("Monitoring %v count at <storage-prefix>/%v", resourceName, prefix)
	stopCh := make(chan struct{})
	go wait.JitterUntil(func() {
		count, err := e.Storage.Count(prefix)
		if err != nil {
			klog.V(5).Infof("Failed to update storage count metric: %v", err)
			metrics.UpdateObjectCount(resourceName, -1)
		} else {
			metrics.UpdateObjectCount(resourceName, count)
		}
	}, period, resourceCountPollPeriodJitter, true, stopCh)
	return func() { close(stopCh) }
}
898665
func Log(x int64, base int) int {
	assert2(base > 1, "base must be > 1")
	ret := 0
	for x >= int64(base) {
		x /= int64(base)
		ret++
	}
	return ret
}
910352
func (l BaseLogger) Logf(fmt string, values ...interface{}) {
	log.Printf(fmt, values...)
}
439559
func (service *Service) LogError(msg string, keyvals ...interface{}) {
	LogError(service.Context, msg, keyvals...)
}
790941
func ToRetryCount(err error) *retryErr {
	if retryErr, ok := err.(*retryErr); ok {
		return retryErr
	} else {
		return nil
	}
}
746681
func rollbarError(logger ClientLogger, format string, args ...interface{}) {
	format = "Rollbar error: " + format + "\n"
	if logger != nil {
		logger.Printf(format, args...)
	} else {
		log.Printf(format, args...)
	}
}