ActionLogger
- Last UpdatedDec 07, 2023
- 3 minute read
The ActionLogger implements a logger instance to record actions with datetimes and a set of tags.
Tags are used to group log messages.
-
Each log can be assigned one or more tags.
-
Allowed tags are assigned in the ActionLogger definition.
-
Tags are useful for filtering and ordering the log messages when presenting or saving on a file.
Platform support
This node is supported on XR-Windows platform only.
|
XR-WIN |
XR-P-WIN |
XR-P-IOS |
XR-P-AND |
XR-P-WASM |
|---|---|---|---|---|
|
Full support |
No support |
No support |
No support |
No support |
|
|
|
|
|
|
Log syntax
The syntax to log a text is "tagList|logText".
The tag list is a comma-separated list of tag names.
Syntax example:
event,right|Pressed button HS52001
There is also a simplified syntax tagText. Log messages that are added in this way are automatically assigned to a tag called default.
Save the log content inside a file
-
Define a list of saveTags.
-
Press Save and then pass the file path.
The list of saveTags defines all and only the groups of log messages that are inside the saved log file.
The order of tags is reflected in the saved file. If a logged message has two or more of the tags defined in saveTags, the message is presented two or more times in the file (one for each tag).
Code example
This is a code example for the ActionLogger node.
<ActionLogger name="logger" tags="events,wrong,right"/>
ActionLogger fields
These are the fields for ActionLogger node. Only the node-specific fields are indicated, not fields obtained by inheritance.
Field inheritance: NodeBase > ActionLogger
|
Fields |
Type |
Use |
Default value |
Description |
|---|---|---|---|---|
|
clear |
sevent |
Optional |
Not set |
Clears the logger. |
|
log |
sstack |
Optional |
Not set |
Registers a new log text. |
|
save |
sevent |
Optional |
Not set |
Saves a log file. |
|
saveTags |
mstring |
Optional |
All |
An ordered list of tags to be recorded in the saved file. |
|
tags |
mstring |
Optional |
Progressive |
Defines the list of accepted tags. If a log tries to use a wrong tag, an exception is raised. |