Interaction and debugging
Once your function is successfully deployed and in a “Running” state, you can interact with it and monitor its execution. This section covers triggering function logic via the CLI and accessing runtime logs.
Invoking Functions
To execute your function and see the result, use the call command group. This allows you to send data to your function and receive the processed output directly in your terminal.
Creating a Call
The call create command triggers the execution of your deployed function.
fathom intelligence function call create <FUNCTION_ID> [OPTIONS]
To read file context stdout can be used:
echo '{}' | fathom intelligence function call create --data - <FUNCTION_ID>
Listing Calls
To see the history of executions, their statuses (e.g., Succeeded, Failed), and execution times:
fathom intelligence function call list <FUNCTION_ID>
Runtime Logs
Debugging a serverless function requires visibility into what happens during execution. The logs command streams the standard output (stdout) and error (stderr) logs from your running instances.
Viewing Function Logs
Unlike build logs, which focus on compilation, these logs show your application’s logic in action (e.g., print statements, caught exceptions, or incoming request traces).
fathom intelligence function logs <FUNCTION_ID>
- Real-time Debugging: Keep this command running with
--watchoption in a separate terminal window while you use call create to see immediate feedback. - Troubleshooting: If a call fails with a generic error, the logs will typically contain the specific stack trace or error message from your code.
Summary
You have completed the full lifecycle of a Fathom Intelligence Function:
- Management: Created the resource.
- Source: Uploaded your code.
- Build/Deploy: Compiled and released the service.
- Interaction: Verified the logic and monitored logs.
Need help? Run fathom --help at any time for a full list of global commands.