...

Package context

import "oras.land/oras-go/pkg/context"
Overview
Index

Overview ▾

func Background

func Background() context.Context

Background returns a default context with logger discarded.

func GetLogger

func GetLogger(ctx context.Context) *logrus.Entry

GetLogger retrieves the current logger from the context. This method wraps github.com/containerd/containerd/log.GetLogger()

func WithLogger

func WithLogger(ctx context.Context, logger *logrus.Entry) context.Context

WithLogger returns a new context with the provided logger. This method wraps github.com/containerd/containerd/log.WithLogger()

func WithLoggerDiscarded

func WithLoggerDiscarded(ctx context.Context) context.Context

WithLoggerDiscarded returns a new context with the logger, writting to nothing.

func WithLoggerFromWriter

func WithLoggerFromWriter(ctx context.Context, writer io.Writer) context.Context

WithLoggerFromWriter returns a new context with the logger, writting to the provided logger.