Writes a log-entry to Hublify's action-log.

Use this CAREFULLY - not to flood / overload the action-log and system!


Syntax

log(string $text, string $type = 'INFO', $params = null)


Parameter

     * @param string $text The plain log-text to write

     * @param string $type optional (default: "INFO"). "OK|WARNING|ERROR|INFO"

     * @param array|null $params optional (additional data) to save along.



Return

Returns always an empty string


Examples

Simple

Logging a simple text as an "OK"-Entry.

{% do hublify.log("Track me! I was rendered!", "OK") %}


It is always best to add more (referencing) data as payload into the log-entry.

{% do hublify.log(
    "Track me! I was rendered!",
    "OK",
    {
      "al_ref_type": "<dataset>",         // (optional) Refers-to: dataset.  E.g. "order" or "person"
      "al_ref_id": "<primarkey-value>",   // (optional) Refers-to: record within dataset.   E.g. "123"
     
      "al_action": "<action>",            // (optional) Process or Action as origin of this log-entry. "E.g. "mail_send"

      "al_data": { <array|object> },      // (optional) Extra-Payload data to log.
                                          //            BE CAREFUL NOT LOG TOO BIG DATA, HERE !
    }
) %}