// ToContext adds the zap.Logger to the context for extraction later.
// Returning the new context that has been created.
// Deprecated: use ctxzap.ToContext
17993
func ToContext(ctx context.Context, logger *zap.Logger) context.Context {
	return ctxzap.ToContext(ctx, logger)
}
277996
func (c *MachinesListCall) Context(ctx context.Context) *MachinesListCall {
	c.ctx_ = ctx
	return c
}
740575
func (builder *UpdateGSetCommandBuilder) WithContext(context []byte) *UpdateGSetCommandBuilder {
	builder.protobuf.Context = context
	return builder
}
276993
func (c *GetMappingCall) Context(ctx context.Context) *GetMappingCall {
	c.ctx_ = ctx
	return c
}
557394
func NewContext(ctx context.Context, l log15.Logger) context.Context {
	return context.WithValue(ctx, loggerKey, l)
}
1275056
func newContext(t time.Duration) context.Context {
	ctx := context.Background()
	if t > 0 {
		ctx, _ = context.WithTimeout(ctx, t)
	}
	return ctx
}
1037304
func CopyToContext(target, source context.Context) context.Context {
	// Copy logger
	if l, ok := logger.FromContext(source); ok {
		target = logger.WithLogger(target, l)
	}

	// Copy reporter
	if r, ok := reporter.FromContext(source); ok {
		target = reporter.WithReporter(target, r)
	}

	// Copy request id
	target = httpx.WithRequestID(target, httpx.RequestID(source))

	// Copy trace span
	if span := opentracing.SpanFromContext(source); span != nil {
		target = opentracing.ContextWithSpan(target, span)
	}

	return target
}
502898
func (c *TaskCancelCall) Context(ctx context.Context) *TaskCancelCall {
	c.ctx_ = ctx
	return c
}
1340159
func (c *ValidateConfigCall) Context(ctx context.Context) *ValidateConfigCall {
	c.ctx_ = ctx
	return c
}
189804
func (c *GetTaskDefCall) Context(ctx context.Context) *GetTaskDefCall {
	c.ctx_ = ctx
	return c
}
611753
func (c *StoreInlineCall) Context(ctx context.Context) *StoreInlineCall {
	c.ctx_ = ctx
	return c
}
28375
func AddContext(err error, context string) error {
	if err == nil {
		return nil
	}
	return Extend(err, New(context))
}
911554
func (c *GroupPercentGetCall) Context(ctx context.Context) *GroupPercentGetCall {
	c.ctx_ = ctx
	return c
}
560340
func (c *AckCall) Context(ctx context.Context) *AckCall {
	c.ctx_ = ctx
	return c
}
770206
func NewContextWithLogger(ctx context.Context, log *zap.Logger) context.Context {
	return context.WithValue(ctx, loggerKey, log)
}
347444
func WrapContext(ctx context.Context) context.Context {
	var objLogger *logger.Logger
	if ctx == nil {
		ctx = context.Background()
		objLogger = logger.GetLogger()
	} else {
		objLogger = GetLogger(ctx)
	}
	return context.WithValue(ctx, logKey, objLogger)
}
731641
func FromContext(ctx context.Context) (*LoggerMeta, bool) {
	v, ok := ctx.Value(loggerMetaKey).(*LoggerMeta)
	return v, ok
}