// FromContext extracts a logger from a context and casts to the log Interface
964264
func FromContext(ctx context.Context) Interface {
	v, ok := ctx.Value(LogCTXKey).(Interface)
	if !ok {
		return nil
	}
	return v
}
496468
func (h *Handler) WithContext(ctx context.Context) {
	go func() {
		<-ctx.Done()
		h.terminating = true
	}()
}
478871
func FromContext(ctx context.Context) lager.Logger {
	l, ok := ctx.Value(contextKey{}).(lager.Logger)
	if !ok {
		return &discardLogger{}
	}

	return l
}
303551
func FromContext(ctx context.Context) (s *Session, ok bool) {
	s, ok = ctx.Value(sessionKey{}).(*Session)
	return
}
923382
func NewContext(parent context.Context, logger lager.Logger) context.Context {
	return context.WithValue(parent, contextKey{}, logger)
}
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
}
249613
func (call *MulticastCall) WithContext(ctx context.Context) *MulticastCall {
	call.ctx = ctx
	return call
}
899847
func FromContext(ctx context.Context) (Reporter, bool) {
	h, ok := ctx.Value(reporterKey).(Reporter)
	return h, ok
}
380016
func (s *MessageRequest) SetContext(v map[string]*string) *MessageRequest {
	s.Context = v
	return s
}
828306
func (call *ReplyMessageCall) WithContext(ctx context.Context) *ReplyMessageCall {
	call.ctx = ctx
	return call
}
37685
func (call *GetGroupMemberProfileCall) WithContext(ctx context.Context) *GetGroupMemberProfileCall {
	call.ctx = ctx
	return call
}
579189
func FromContext(ctx context.Context) Logger {
	logger, ok := ctx.Value("termlog").(Logger)
	if !ok {
		l := NewLog()
		l.Quiet()
		return l
	}
	return logger
}
856883
func NewContextLogger(ctx context.Context, logger log.Logger) context.Context {
	return context.WithValue(ctx, ctxKeyLogger, logger)
}
709835
func (call *GetMessageContentCall) WithContext(ctx context.Context) *GetMessageContentCall {
	call.ctx = ctx
	return call
}
598963
func (l *Logger) GetContext(key string) (interface{}, bool) {
	l.globalsL.RLock()
	defer l.globalsL.RUnlock()
	val, ok := l.globals[key]
	return val, ok
}
240680
func (builder *UpdateMapCommandBuilder) WithContext(context []byte) *UpdateMapCommandBuilder {
	builder.protobuf.Context = context
	return builder
}
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
}