Day #15 with Cloud Workflows: built-in cloud logging function
To call the built-in logging function, just create a new step, and make a call to the sys.log function:
This function takes a mandatory parameter: text. And an optional one: severity.
The text parameter accepts all types of supported values, so it’s not only string, but all kinds of numbers, as well as arrays and dictionaries. Their string representation will be used as text.
The optional severity parameter is an enum that can take the values: DEFAULT, DEBUG, INFO, NOTICE, WARNING, ERROR, CRITICAL, ALERT, EMERGENCY, with DEFAULT being… the default value if you don’t specify a severity!
Here’s another example with a dictionary as parameter, which will be output as text in the logs, and a severity of WARNING:
Looking at the results in the cloud logging console, you will see both messages appear:
Don’t hesitate to have a look at reference documentation to find more about the available built-in functions.