Documentation ¶
Index ¶
- func NewContext(ctx context.Context, instrumentOpts instrument.Options, ...) context.Context
- func NewContextWithGeneratedID(ctx context.Context, instrumentOpts instrument.Options) context.Context
- func NewContextWithID(ctx context.Context, id string, instrumentOpts instrument.Options) context.Context
- func NewContextWithLogger(ctx context.Context, l *zap.Logger) context.Context
- func ReadContextID(ctx context.Context) string
- func WithContext(ctx context.Context, instrumentOpts instrument.Options) *zap.Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewContext ¶
func NewContext( ctx context.Context, instrumentOpts instrument.Options, fields ...zapcore.Field, ) context.Context
NewContext returns a context has a zap logger with the extra fields added.
func NewContextWithGeneratedID ¶
func NewContextWithGeneratedID( ctx context.Context, instrumentOpts instrument.Options, ) context.Context
NewContextWithGeneratedID returns a context with a generated id with a zap logger and an id field.
func NewContextWithID ¶
func NewContextWithID( ctx context.Context, id string, instrumentOpts instrument.Options, ) context.Context
NewContextWithID returns a context which has a zap logger and an id field.
func NewContextWithLogger ¶ added in v1.2.0
NewContextWithLogger returns a context with the provided logger set as a context value.
func ReadContextID ¶
ReadContextID returns the context's id or "undefined".
func WithContext ¶
WithContext returns a zap logger with as much context as possible.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.