The "log" tag

Every task run involves rendering a task's Liquid script, and interpreting the resulting JSON objects. Action objects become actions (see the "action" tag), error objects become errors (see the "error" tag) – and, for a quieter way to record information for debugging or general logging, log objects are simply recorded for your later reference.

We support these using vanilla JSON, and using a "log" tag as a shorthand.

{"log": "Something to note!"}
{"log": {"publications_named": {{ publications_named | json }}}}

{% log "Something to note" %}
{% log publications_named: publications_named %}

Like the other objects rendered, log objects are available in the task run's results:


Block syntax

Using unadorned log and endlog tags, provide your own valid JSON content.

{% log %}
  {{ "There are " | append: count | append: " things we should know." | json }}
{% endlog %}

When rendered, this becomes:

{"error": "There are 12 things we should know."}

Tag syntax

Using only a log tag, provide either an array of arguments, or a hash of arguments:

{% log "Something to recall" %}
{% log more_details %}
{% log "Something to recall", more_details %}
{% log message: "Something to recall", details: more_details %}
{"error": "Something to recall"}
{"error": {"more": "details"}}
{"error": ["Something to recall", {"more": "details"}]}
{"error": {"message": "Something to recall", "details": {"more": "details"}}}
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.