generated at
GCP Cloud Functions Debuging
Node.jsは、local emulatorがあるが、、Function Frameworkというのに移行してる?
Pythonは、Flaskの環境を作ればよい。
http triggerの場合は、そのままでよい。
event triggerの場合は... (さらに)mockする


nodeで emulatorの場合のみ?
launch.jsonを書く。
launch.json
{ "type": "node", "request": "attach", "name": "Foo Attach", "port": 9229}
breakpointを貼る。
debuggingをOn?にする。Foo Attachを選んで。
ここが、何をしてるのかよくわかってない。 attachというのは、プロセスを操作する状態になった?という意味?
functions emulator側:
$ functions deploy foo_functions --entry-point=my_entry_point --trigger-http
$ functions inspect foo_functions
これで、port 9229をlistenするdebuggerが立ち上がる

この状態で、 functions call foo_functions とすると、関数実行して vscodeは 9229にattachしてるので、breakpointで止まる
ちょっとめんどくさいかも。。
ただ、print debug以外の方法が、現状これしか、私にはない。
あと、local emulatorでは良くて、実際のGCP側でうまく動かない(特にpuppeteerの場合)