Testing, Logging, and Monitoring
This document guides you on how to perform testing, access logs, and monitor data in the cloud development console.
Testing
Cloud Development provides a cloud function testing feature, making it more convenient to debug your code.
- CloudBase Online Development
- CloudBase Console
- WeChat Developer Tools
1. Enter "Online Development" Mode
On the cloud function list interface, locate the cloud function you want to debug, click its corresponding "Online Development" button to enter Online Development mode.
2. Click the "[Cloud Function] Debug" menu to start the debugging service
There are two places to access the "[Cloud Function] Debug" menu:
- One way is to right-click on the cloud function directory you want to debug
- Another way is to right-click within the open cloud function code editor
3. Set breakpoints, fill in parameters, and click "Run Test"
Wait for the debugging service to start, then you can begin debugging.
In the management panel of the corresponding cloud function in the console, click "Test" to open the test pop-up window.
- Click the "Submit Method" dropdown menu to select a template method for testing the function. Currently, only the
Hello World
event template is supported. The template is passed to the function as the event parameter during testing. - After entering the parameters to be tested in the "Test Parameters" editor, click "Execute" to run the code. Once execution is complete, the result will be displayed in the "Run Test" panel.
In addition to the visual cloud function testing feature, we also provide the command-line tool scf-cli to help you debug locally quickly.
In the management panel of the corresponding cloud function in the console, click "Cloud Test" to open the test pop-up window.
- Click the "Submit Method" dropdown menu to select a template method for testing the function. Currently, only the
Hello World
event template is supported. The template is passed to the function as the event parameter during testing. - After entering the parameters to be tested in the "Test Parameters" editor, click "Execute" to run the code. Once execution is complete, the result will be displayed in the "Run Test" panel.
In addition to the visual cloud function testing feature, we also provide the command-line tool scf-cli to help you debug locally quickly.
Log
Log in to the console, click "Log" to enter the log page where you can view the invocation logs of cloud functions, facilitating code debugging for developers.
- CloudBase Console
- WeChat Developer Tools
Monitoring
Log in to the console, click "Monitoring" to enter the monitoring page where you can view the number of invocations, execution duration, and error count of cloud functions. Click "Export Data" to export all this data.
- CloudBase Console
- WeChat Developer Tools