logging

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2026 License: Apache-2.0 Imports: 5 Imported by: 5 modules, 38 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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

func NewContextWithLogger(ctx context.Context, l *zap.Logger) context.Context

NewContextWithLogger returns a context with the provided logger set as a context value.

func ReadContextID

func ReadContextID(ctx context.Context) string

ReadContextID returns the context's id or "undefined".

func WithContext

func WithContext(ctx context.Context, instrumentOpts instrument.Options) *zap.Logger

WithContext returns a zap logger with as much context as possible.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL