// FromContext Gets the logger from context
199485
func FromContext(ctx context.Context) Logger {
	if ctx == nil {
		panic("nil context")
	}

	logger, ok := ctx.Value(loggerKey).(Logger)
	if !ok {
		logger = mainLogger
	}

	return logger
}
290180
func LoggerFromContext(ctx context.Context) (logger log.Logger, ok bool) {
	logger, ok = ctx.Value(ctxKeyLogger).(log.Logger)
	return
}
586796
func (o *GetEndpointIDLogParams) WithContext(ctx context.Context) *GetEndpointIDLogParams {
	o.SetContext(ctx)
	return o
}
58830
func FromContext(ctx context.Context) XStater {
	rc, ok := ctx.Value(xstatsKey).(XStater)
	if ok {
		return rc
	}
	return nop
}
946425
func FromContext(ctx context.Context, opts ...WriterOption) (Writer, bool, context.Context) {
	v := ctx.Value(contextKey)
	pw, ok := v.(*progressWriter)
	if !ok {
		if pw, ok := v.(*MultiWriter); ok {
			return pw, true, ctx
		}
		return &noOpWriter{}, false, ctx
	}
	pw = newWriter(pw)
	for _, o := range opts {
		o(pw)
	}
	ctx = context.WithValue(ctx, contextKey, pw)
	return pw, true, ctx
}
210302
func FromContext(ctx context.Context) (*Tracer, bool) {
	// ctx.Value returns nil if ctx has no value for the key;
	// the net.IP type assertion returns ok=false for nil.
	t, ok := ctx.Value(tracerKey).(*Tracer)
	return t, ok
}
206568
func (s *StatusEvent) GetContext() string {
	if s == nil || s.Context == nil {
		return ""
	}
	return *s.Context
}
1197534
func (call *GetMessageQuotaCall) WithContext(ctx context.Context) *GetMessageQuotaCall {
	call.ctx = ctx
	return call
}
103227
func WithContext(ctx context.Context) FeatureOption {
	return func(opts *featureOption) {
		opts.ctx = &ctx
	}
}
292853
func (ml *MockRouteCountLogger) GetContext(key string) (interface{}, bool) {
	return ml.logger.GetContext(key)
}
964264
func FromContext(ctx context.Context) Interface {
	v, ok := ctx.Value(LogCTXKey).(Interface)
	if !ok {
		return nil
	}
	return v
}
472842
func FromContextError(err error) *Status {
	switch err {
	case nil:
		return New(codes.OK, "")
	case context.DeadlineExceeded:
		return New(codes.DeadlineExceeded, err.Error())
	case context.Canceled:
		return New(codes.Canceled, err.Error())
	default:
		return New(codes.Unknown, err.Error())
	}
}
923730
func FromContext(ctx context.Context) (Stats, bool) {
	stats, ok := ctx.Value(statsKey).(Stats)
	return stats, ok
}
828952
func FromModuleContext(ctx context.Context) (ModuleCtx, bool) {
	mc, ok := ctx.Value(moduleCtxKey{}).(ModuleCtx)
	return mc, ok
}
731641
func FromContext(ctx context.Context) (*LoggerMeta, bool) {
	v, ok := ctx.Value(loggerMetaKey).(*LoggerMeta)
	return v, ok
}
805962
func (logger *Logger) WithContext(ctx context.Context) *Entry {
	entry := logger.newEntry()
	defer logger.releaseEntry(entry)
	return entry.WithContext(ctx)
}
883144
func FromContext(c context.Context) *Goon {
	return &Goon{
		Context:          c,
		cache:            make(map[string]interface{}),
		KindNameResolver: DefaultKindName,
	}
}