Log to console

Actions – Abstract

The action Log to console is used to transfer certain data by Behaviours within a form to the browser's developer console for debugging and analysis.

The action Log to console is used to transfer certain data by Behaviours within a form to the browser's developer console for debugging and analysis.

images/download/attachments/189434712/image-2024-10-16_16-49-59-version-1-modificationdate-1729090198949-api-v2.png

  • If no target element is linked, the behaviour data is written as console output.

  • If a target element is linked, the data of the target element is written as console output.

The Prefix defined within the behaviour (default value: 'ConsoleLogger') is attached to every line of console output, in order to identify the origin of an individual entry in a typically well populated console.

Besides, a Level must be assigned when a log entry is generated. Listed in order of descending urgency, choices are: 'FATAL', 'ERROR', 'WARN', 'INFO' (default), 'DEBUG' and 'TRACE'. The impact of this classification of entries by Level on the representation in the console may vary per browser. Typically, some form of filtering by a list of categories is supported, which only partially correspond with the options for Level.

If the browser features a free text filter for restricting displayed lines of console output, both Prefix and Level texts may serve as filter criteria. The key values for Level appear as strings enclosed in square brackets (e.g. '[INFO]').

►IMPORTANT◄ By default, the client will only output the Levels 'FATAL', 'ERROR' and 'WARN' to the console. Lower Level entries will only appear, if the client was started in debug mode.

Examples

Logging the value of a specific element in the console

A portal is designed to apply a 'whitelist' of values for the address component Country (e.g. in an order's consignee address) selected by a Multiselect combobox element as criterion for a Suche (Formulardesigner).

In the course of testing this portal, the value of the Multiselect combobox defining the key search criterion should be written to the browser console.

images/download/attachments/189434712/image2020-3-30_15-7-26-version-1-modificationdate-1729090105718-api-v2.png

  • The behaviour 'searchByCountries' responds to the Triggering event 'Clicked' of the 'Search orders' button (orange arrow).

  • Under Actions on 'true', the action Log to console is executed with the Multiselect combobox linked as a Target element (green arrow) before the search results are displayed by Grid: Fill.

At runtime and with the DACHL countries selected here by default, console output by this action might look as follows:

images/download/attachments/189434712/image2020-3-30_16-16-20-version-1-modificationdate-1729090105721-api-v2.png

  • The Multiselect combobox returns a list of values from the dynamic enumeration for Country, listed here as objects (indexed from 0 to 3).

  • Each element in this list may be expanded by the '►' symbol, to show more details. The value of the internal _name, which is the relevant key for the search, is already visible in the header row.

  • The final prototype element indicates the data type of the value (here: Array[]), but may be otherwise ignored.

Logging 'behaviour data' to the console

As an amendment to the configuration from the previous example, the return values of the Search (Form designer) should appear in the console below the filter criterion.

images/download/attachments/189434712/image-2024-10-17_9-4-51-version-1-modificationdate-1729148690660-api-v2.png

  • A second instance of the Log to console action is introduced for this purpose, without linking a target element.

  • For an easier distinction between the two types of output, Level is set to 'WARN' instead of 'FATAL' and the Prefix '___Search_Result___' is assigned.

The following screenshot shows both types of output combined, with the first entry (red/FATAL) collapsed and the second (yellow/WARN) expanded across several levels:

images/download/attachments/189434712/image2020-3-30_12-52-30-version-1-modificationdate-1729090105707-api-v2.png

  • The individual rows returned as a search result appear as indexed child elements of _dataProvider/_buffer.

  • These rows represent complete Orders, including attributes and line items (if any). This complex data structure can be expanded step-by-step as required during the analysis.