logger

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProductionLogLevel is the level for the production log.
	ProductionLogLevel LogLevel = "PRODUCTION"
	// DevelopmentLogLevel is the level for development log.
	DevelopmentLogLevel LogLevel = "DEVELOPMENT"
	// EnvLoggerLevel is the environment variable name for log level.
	EnvLoggerLevel = "LOGGER_LEVEL"
	// LogCtxIDKey holds the TraceId for log.
	LogCtxIDKey = "TraceId"
)

Variables

This section is empty.

Functions

func GetLogger

func GetLogger(ctx context.Context) *zap.SugaredLogger

GetLogger returns SugaredLogger associated with given context.

func GetNewContextWithLogger

func GetNewContextWithLogger(key string) (context.Context, *zap.SugaredLogger)

GetNewContextWithLogger creates a new context with context UUID and logger set func returns both context and logger to the caller.

func NewContextWithLogger

func NewContextWithLogger(ctx context.Context, key string) context.Context

NewContextWithLogger returns a new child context with context ID set

Types

type LogLevel

type LogLevel string

LogLevel represents the level for the log.

Jump to

Keyboard shortcuts

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