Log
The Log node is a utility node that allows you to log messages and data to the console during the execution of a spell. It is useful for debugging, monitoring, and understanding the flow of data through your spell.Inputs
flow(required): The input flow that triggers the Log node.text(optional, default: ""): The message to be logged to the console.severity(optional, default: “info”): The severity level of the log message. Can be one of “info”, “warning”, or “error”.payload(optional, default: ): An object containing additional data to be logged along with the message.
Outputs
flow: The output flow that is triggered after the log message is recorded.
Configuration
This node has no additional configuration options.Usage
- Connect the
flowinput to the desired point in your spell where you want to log a message. - (Optional) Set the
textinput to the message you want to log. - (Optional) Choose the appropriate
severitylevel for your log message. - (Optional) Provide an object to the
payloadinput to include additional data in the log. - Connect the
flowoutput to the next node in your spell.
Example
Here’s an example of how to use the Log node in a spell:inputString1 node. The severity is set to “info”. When the spell is run, it will output:
Best Practices
- Use meaningful log messages that provide context about what is happening in your spell.
- Choose the appropriate severity level for your logs. Use “info” for general messages, “warning” for potential issues, and “error” for critical problems.
- Be mindful of logging sensitive or private data. Avoid including passwords, API keys, or personal information in logs.
Common Issues
- Forgetting to connect the
flowinput can result in the Log node not being triggered. - Not providing a
textinput will result in an empty log message. - Incorrect severity levels may lead to confusion when reviewing logs.
