Google Cloud's operations suite provides logging and monitoring tools that help you understand what is happening in your functions.
Writing and viewing logs
Cloud Logging captures, stores, and analyzes Cloud Functions logs.
Read more about writing and viewing logs from Cloud Functions.
Error Reporting captures specially formatted error logs and displays them in the Error Reporting dashboard.
Read more about reporting errors from Cloud Functions.
Viewing monitored metrics
Cloud Monitoring records metrics regarding the execution of Cloud Functions.
Read more about viewing recorded metrics for Cloud Functions.