Runtime: nodejs8
Export log from Stackdriver Logging to PubSub.
Get Slack incoming Webhook URL.
You can find the logs in "Global".
$ export PUBSUB_TPOIC=<your pubsub topic>
$ export SLACK_WEBHOOK_URL=<your slack incoming webhook url>
$ gcloud beta functions deploy cf-stackdriver-logging-to-slack \
--runtime=nodejs8 \
--trigger-topic $PUBSUB_TPOIC \
--source=. \
--set-env-vars SLACK_WEBHOOK_URL=$SLACK_WEBHOOK_URL \
--entry-point=subscribe