// LogCtx Low level log with depth , level, message and logger
350892
func LogCtx(ctx context.Context, depth, logLvl int, format string, v ...interface{}) {
	if LogLevel >= logLvl {
		msg := fmt.Sprintf(format, v...)
		lc := FromContext(ctx)
		if len(lc) > 0 {
			msg = fmt.Sprintf("%s %s", lc, msg)
		}
		DoLog(depth+1, logLvl, msg)
	}
}
850967
func (f *asyncFlusher) ctx(chunkIndex int32) context.Context {
	return logging.SetField(f.Context, "chunk", chunkIndex)
}
1049179
func (d DefaultLogger) Log(level LogLevel, a ...interface{}) (n int, err error) {
	if level >= logThreshhold {
		fmt.Fprint(os.Stderr, prefix(level)+" ")
		return fmt.Fprintln(os.Stderr, a...)
	}
	return 0, nil
}
494974
func Logf(level LogLevelType, format string, args ...interface{}) {
	root.Logf(level, format, args...)
}
228833
func (c *Connection) logx(v ...interface{}) {
	_, fn, ld, ok := runtime.Caller(1)

	c.sessLock.Lock()
	if ok {
		c.logger.Printf("%s %s %d %v\n", c.session, fn, ld, v)
	} else {
		c.logger.Printf("%s %v\n", c.session, v)
	}
	c.sessLock.Unlock()
	return
}
1207817
func SetLogLevel(ctx context.Context, lvl log.Level) {
	if logCtx, ok := ctx.(*lsc); ok {
		if lvl == logCtx.logger.Level {
			return
		}
		if logCtx.loggerInherited {
			parentLogger := logCtx.logger
			logCtx.logger = &log.Logger{
				Formatter: parentLogger.Formatter,
				Out:       parentLogger.Out,
				Hooks:     parentLogger.Hooks,
				Level:     lvl,
			}
			logCtx.loggerInherited = false
		}
	}
}
908043
func (log Logger) Logf(lvl level, format string, args ...interface{}) {
	log.intLogf(lvl, format, args...)
}
149122
func (lgr *logger) LogAtLevel(level LogPriority, format string, v ...interface{}) {
	switch level {
	case DEBUG:
		lgr.Debug(format, v...)
	case INFO:
		lgr.Info(format, v...)
	case WARNING:
		lgr.Warn(format, v...)
	case ERR:
		lgr.Error(format, v...)
	}
}
1022146
func (logger *Logger) Logf(level log.Level, format string, args ...interface{}) {
	logger.output(level, fmt.Sprintf(format, args...))
}
677272
func LogLevel() string {
	envLevel := os.Getenv(EnvLog)
	if envLevel == "" {
		return ""
	}

	logLevel := "TRACE"
	if isValidLogLevel(envLevel) {
		// allow following for better ux: info, Info or INFO
		logLevel = strings.ToUpper(envLevel)
	} else {
		log.Printf("[WARN] Invalid log level: %q. Defaulting to level: TRACE. Valid levels are: %+v",
			envLevel, ValidLevels)
	}

	return logLevel
}
284746
func (l *Logger) Logf(level Level, format string, args ...interface{}) {
	msg := fmt.Sprintf(format, args...)
	l.Log(level, msg)
}
416274
func LogThrottle(logLvl, limit int, format string, v ...interface{}) {
	if LogLevel < logLvl {
		return
	}
	doLogThrottle(4, logLvl, limit, format, fmt.Sprintf(format, v...))
}
1180128
func (l *withLogger) LogWith(level Level, calldepth int, data []byte, format string, args ...interface{}) {
	if l.GetLevel() >= level {
		l.output(level, calldepth, data, format, args...)
	}
}
389252
func (s *Sender) SendCtx(ctx context.Context, req *http.Request) (resp *http.Response, err error) {
	return s.ExecWithRetry(fmt.Sprintf("%s request to %s", req.Method, req.URL), func() (*http.Response, error) { return ctxhttp.Do(ctx, s.client, req) })
}
1218892
func (log Logger) Logc(lvl level, closure func() string) {
	log.intLogc(lvl, closure)
}
1168779
func (l *Logger) Log(level Level, v ...interface{}) {
	l.print(level, fmt.Sprint(v...), l.NewLine)
}
767357
func LogThrottleD(depth, logLvl, limit int, format string, v ...interface{}) {
	if LogLevel < logLvl {
		return
	}
	doLogThrottle(depth, logLvl, limit, format, fmt.Sprintf(format, v...))
}