logutil

package
v0.0.0-...-572c485 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 StreamTraceLoggerInterceptor

func StreamTraceLoggerInterceptor(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error

StreamTraceLoggerInterceptor add a traced logger in stream rpc call ctx

func UnaryTraceLoggerInterceptor

func UnaryTraceLoggerInterceptor(ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

UnaryTraceLoggerInterceptor adds a traced logger in unary rpc call ctx

func WithModule

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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