Logger System
The Logger system provides logging functionality for debugging and monitoring flow execution.
Overview
Logger functions allow you to output messages at different severity levels. These messages appear in the execution history and can help you debug issues or track flow progress.
Log Levels
- Info: General informational messages
- Warn: Warning messages for potential issues
- Error: Error messages for failures
- Debug: Detailed debugging information
Available Functions
- Logger.info() - Log an informational message
- Logger.warn() - Log a warning message
- Logger.error() - Log an error message
- Logger.debug() - Log a debug message
Common Use Cases
Progress Tracking
Logger.info("Starting data processing...")
-- ... processing code ...
Logger.info("Data processing complete")
Error Handling
local success, result = pcall(someFunction)
if not success then
Logger.error("Failed to process data: " .. tostring(result))
end
Debugging
Logger.debug("Current state: " .. SessionState.get("currentStep"))
Logger.debug("Input value: " .. inputs.value)
Warnings
if tonumber(inputs.count) > 1000 then
Logger.warn("Large count detected: " .. inputs.count)
end
Best Practices
- Use Appropriate Levels: Use
infofor normal flow,warnfor potential issues,errorfor failures - Include Context: Add relevant information to log messages
- Don't Over-Log: Avoid logging in tight loops or high-frequency operations
- Use Debug Sparingly: Debug logs are verbose - use them when troubleshooting