Open ebruchez opened 1 year ago
+1 today for trace
ing actions! This is essential. Could be done as part of the inspector, which this issue covers, or a separate console (#2169).
We still, as of Orbeon Forms 2022.1, have two formats of actions:
In either case, if we log "actions", we should log the higher-level actions, not their translation into lower-level XForms actions (even though that would already be useful compared to having nothing).
I think that this means that every action implementation in actions-20282.xsl
(and actions.xsl
if don't do #3855 first) should also (possibly optionally) generate an explicit log entry.
A log action should also have a name/category so that the logging console can filter on that:
<xxf:log name="orbeon.actions" level="debug" value="..."/>
Implementation possibilities:
xxf:log
You could imagine a lower-level approach where the entire logging system (we use slf4j/log4s) can be configured to redirect to the inspector. However, this doesn't seem easy to do and is probably too low-level.
So instead, if we'd like the output to go to a log file but optionally to the inspector, we should go through our own higher-level system.
xxf:log
actionxxf:log
: consider nested <xf:property>
<xf:property>
in actionsfr:xforms-inspector
console is currently a single text value; should make this more efficient
<xxf:log>
output<xxf:log>
outputOne issue with xxf:log
is that, if we use an XBL component for the console, and that component listens to events, events that are dispatched before the UI is ready, including logging happening in actions running before the controls are ready, will not show.
Solutions:
So solution 1 is probably the way to go. The event buffer could have a certain limit, and be cleared as soon as the UI is ready or they are consumed, whichever comes first.
Originally a comment on #5799.
Ideas:
<xf:message>
to write to inspector console and/or JavaScript consoletrace
actionsHow would we tell
<xf:message>
to target the inspector console? Options:level="xxf:inspector"
level=""xxf:inspector-debug
xxf:log-debug
, etc.level="xxf:log-info" xxf:log-target="inspector"
xxf:log-target="inspector"
inheritableI think it would be good to separate:
We could have:
level="xxf:debug"
:xxf:log-debug
xxf:log-target="logger|inspector|javascript-console"
Alternatively, we could introduce:
Does it make sense to split message/log? Maybe! Also,
xxf:log
would be shorter.