logutil

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BgLogger

func BgLogger() *zap.Logger

func LogPanic

func LogPanic()

LogPanic logs the panic reason and stack, then exit the process. Commonly used with a `defer`.

func Logger

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

func SetupLogger

func SetupLogger(cfg *log.Config)

SetupLogger is used to initialize the log with config.

func WithField

func WithField(ctx context.Context, key string, value string) context.Context

WithField adds given kv field to the logger in ctx

func WithLogger

func WithLogger(ctx context.Context, logger *zap.Logger) context.Context

func WithModule

func WithModule(ctx context.Context, module string) context.Context

WithModule adds given module field to the logger in ctx

func WithReqID

func WithReqID(ctx context.Context, reqID int64) context.Context

WithReqID adds given reqID field to the logger in ctx

Types

This section is empty.

Jump to

Keyboard shortcuts

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