Log Functions#
fn.log: Given a log level and message, display it in the log. Log levels can be: debug, critical, warn, error or info.
fn.txn_log: Given a message, display it in the transaction log on the Admin Portal.
The macro is typically added to a workflow “Set” step for debugging purposes.
Examples:
Example |
Output |
---|---|
{{fn.log info,
This is an
informational message.}}
{{fn.log debug,
Debug message.}}
|
In INFO This is an informational
message.
DEBUG Debug message.
|
A workflow (1PWF) step Set variable “bar” is a message with the value of “name”. {{fn.txn_log pwf.name}}
|
{
"set_list": [
{
"set_var_name": "name",
"set_var_value": "foo"
},
{
"set_var_name": "bar",
"set_var_value":
"{{fn.txn_log pwf.name}}"
}
],
"bar": "foo",
"name": "foo"
}
|
For examples of the macros below, refer to the example for Custom Messages and Details in Provisioning Workflows.
fn.set_current_transaction_detail(<detail_text>)
To customize the transaction detail of the current transaction: top (ancestor) or child transaction. If a transaction fails, this detail will also override the standard detail.
fn.set_top_level_transaction_detail(<detail_text>)
To customize the transaction detail of the top (ancestor) transaction. If there is no top transaction, it will customize the current transaction detail. If a transaction fails, this detail will also override the standard detail.
fn.set_current_transaction_message(<message_text>)
To customize the transaction message of the current transaction: top or child transaction. If a transaction fails, this message will not override the standard error message.
fn.set_top_level_transaction_message(<message_text>)
To customize the transaction message of the top transaction. If there is no top transaction, it will customize the current transaction message. If a transaction fails, this message will not override the standard error message.