logging

package
v0.53.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	String  = zap.String
	Strings = zap.Strings
	Error   = zap.Error
	Uint32  = zap.Uint32
)

Implement missing functions here.

Functions

func FromContext

func FromContext(ctx context.Context) *zap.Logger

FromContext returns the logger from the context if one exists. Otherwise it returns a new logger.

func GRPCLogFieldsToZap added in v0.30.0

func GRPCLogFieldsToZap(fields logging.Fields) []zap.Field

func InitLogging

func InitLogging(ctx context.Context, level string, zapCore zapcore.Core)

InitLogging initializes the global logger.

func ReqScopeLog added in v0.30.0

func ReqScopeLog(ctx context.Context) *zap.Logger

ReqScopeLog returns a request-scoped logger with request fields populated.

func ToContext

func ToContext(ctx context.Context, log *zap.Logger) context.Context

ToContext adds a logger to the context.

Types

type Logger added in v0.47.0

type Logger struct {
	*zap.SugaredLogger
}

func NewLogger added in v0.47.0

func NewLogger(name string) *Logger

Jump to

Keyboard shortcuts

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