improves godoc comments for gRPC server and logger components
This commit is contained in:
@@ -8,19 +8,19 @@ import (
|
||||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
|
||||
// A grpc logging middleware compatible logger
|
||||
// GRPCLogger is a grpc logging middleware compatible logger
|
||||
// implementation using a zerolog logger, either from
|
||||
// the global logger or a context logger
|
||||
// the global logger or a context logger.
|
||||
type GRPCLogger struct {
|
||||
logger zerolog.Logger
|
||||
}
|
||||
|
||||
// Returns a grpcLogger using the global zerolog Logger
|
||||
// NewGRPCLogger returns a grpcLogger using the global zerolog Logger.
|
||||
func NewGRPCLogger() *GRPCLogger {
|
||||
return &GRPCLogger{logger: log.Logger}
|
||||
}
|
||||
|
||||
// Returns a grpcLogger using the zerolog logger in the provided context
|
||||
// NewGRPCContextLogger returns a grpcLogger using the zerolog logger in the provided context.
|
||||
func NewGRPCContextLogger(ctx context.Context) *GRPCLogger {
|
||||
logger := log.Ctx(ctx)
|
||||
return &GRPCLogger{logger: *logger}
|
||||
|
Reference in New Issue
Block a user