Documentation ¶
Index ¶
- func LogPanic()
- func Logger(ctx context.Context) *zap.Logger
- func SetupLogger(cfg *log.Config)
- func StreamTraceLoggerInterceptor(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, ...) error
- func UnaryTraceLoggerInterceptor(ctx context.Context, req any, info *grpc.UnaryServerInfo, ...) (interface{}, error)
- func WithModule(ctx context.Context, module string) context.Context
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 SetupLogger ¶
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
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.