// NewContextWithLogger returns a new context with log added.
770206
func NewContextWithLogger(ctx context.Context, log *zap.Logger) context.Context {
	return context.WithValue(ctx, loggerKey, log)
}
630939
func NewContext(ctx context.Context, ci CallInfo) context.Context {
	return context.WithValue(ctx, callInfoKey, ci)
}
608565
func NewContext(ctx context.Context, xs XStater) context.Context {
	return context.WithValue(ctx, xstatsKey, xs)
}
1077637
func (jf openTracingService) NewContext(parent context.Context, s Span) context.Context {
	span, ok := s.(openTracingSpan)
	if !ok {
		return nil
	}
	return opentracing.ContextWithSpan(parent, span.otSpan)
}
238697
func NewContextWriter(ctx context.Context, w io.Writer) io.Writer {
	return ctxio.NewWriter(ctx, w)
}
841445
func ToContext(ctx context.Context, entry *logrus.Entry) context.Context {
	l := &ctxLogger{
		logger: entry,
		fields: logrus.Fields{},
	}
	return context.WithValue(ctx, ctxLoggerKey, l)
}
164567
func NewReaderWithContext(r io.Reader, ctx context.Context) *Reader {
	return &Reader{
		r:   r,
		ctx: ctx,
	}
}
676388
func (db *DB) WithContext(ctx context.Context) *DB {
	return newDB(ctx, db.baseDB)
}
586796
func (o *GetEndpointIDLogParams) WithContext(ctx context.Context) *GetEndpointIDLogParams {
	o.SetContext(ctx)
	return o
}
960511
func newLogger(c *Context) (log15.Logger, error) {
	lvl := c.String(FlagLogLevel)
	l := log15.New()
	log.Println(fmt.Sprintf("Using log level %s", lvl))
	v, err := log15.LvlFromString(lvl)
	if err != nil {
		return l, err
	}
	h := log15.LvlFilterHandler(v, log15.StreamHandler(os.Stdout, log15.LogfmtFormat()))
	if lvl == "debug" {
		h = log15.CallerFileHandler(h)
	}
	l.SetHandler(log15.LazyHandler(h))
	return l, err
}
104318
func (g *GcsFS) NewReaderWithContext(ctx context.Context, o string) (io.ReadCloser, error) {
	rc, err := g.gcsb().Object(o).NewReader(ctx)
	if err == storage.ErrObjectNotExist {
		return rc, cloudstorage.ErrObjectNotFound
	}
	return rc, err
}
298871
func NewContext(ctx context.Context, msg *sqs.Message) context.Context {
	return context.WithValue(ctx, sqsMessageKey, msg)
}
284630
func NewContext(ctx context.Context, logger Logger) context.Context {
	return context.WithValue(ctx, "termlog", logger)
}
237290
func ContextLogger(ctx context.Context) LogAdapter {
	if v := ctx.Value(logKey); v != nil {
		return v.(LogAdapter)
	}
	return nil
}
877219
func (l Logger) With() Context {
	context := l.context
	l.context = make([]byte, 0, 500)
	if context != nil {
		l.context = append(l.context, context...)
	}
	return Context{l}
}
71351
func (c *context) New(prefixes ...interface{}) Logger {
	return newContext(c.logger, c.prefix, prefixes...)
}
1198398
func ToContext(ctx context.Context, logger *zap.Logger) context.Context {
	l := &ctxLogger{
		logger: logger,
	}
	return context.WithValue(ctx, ctxMarkerKey, l)
}