improves godoc comments for gRPC server and logger components

This commit is contained in:
2025-08-14 09:03:44 -04:00
parent 9cee9037e4
commit e1d58c0094
2 changed files with 7 additions and 6 deletions

View File

@@ -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}