Documentation
¶
Overview ¶
Package logger provides a general logging tools
Index ¶
Constants ¶
View Source
const Text = "text"
Text is the constant for the text format
Variables ¶
This section is empty.
Functions ¶
func FromFlags ¶
func FromFlags(cfg config.LoggingConfig) zerolog.Logger
FromFlags configures logging and returns a logger with settings matching the supplied cfg. It also performs some global initialization, because that's how zerolog works.
func Interceptor ¶
func Interceptor() grpc.UnaryServerInterceptor
Interceptor creates a gRPC unary server interceptor that logs incoming requests and their responses using the Zerolog logger attached to the context.Context. Successful requests are logged at the info level and error requests are logged at the error level.
Returns:
- grpc.UnaryServerInterceptor: The gRPC unary server interceptor function.
Example usage:
server := grpc.NewServer( ... grpc.UnaryInterceptor(logger.Interceptior), ... )
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.