// WithLogger will attach the given logger to a parent context.
WithLogger will attach the given logger to a parent context.
// WithLogger will attach the given logger to a parent context .
func WithLogger(parent context.Context, logger *zap.Logger) context.Context {
	if parent == nil {
		parent = context.Background()
	}
	if logger == nil {
		return parent
	}
	return context.WithValue(parent, keyLogger, logger)
}
func WithLogger ( parent context . Context , logger * zap . Logger ) context . Context { if parent == nil { parent = context . Background ( ) } if logger == nil { return parent } return context . WithValue ( parent , keyLogger , logger ) }
WithLogger will attach the given logger to a parent context.
WithLogger will attach the given logger to a parent context .