- From: Steven Pemberton <steven.pemberton@cwi.nl>
- Date: Tue, 29 Jan 2019 17:22:34 +0100
- To: public-xformsusers@w3.org, iturcan@drake.sk
- Message-ID: <op.zwdzrw17smjzpq@steven-xps>
In such situations, I keep an instance for logging messages, that can be saved and/or viewed as and when necessary. <instance id="log"> <log xmlns=""> <message/> </log> </instance> <action ev:event="xforms-link-error"> <insert ref="instance('log')/message"/> <setvalue ref="instance('log')/message[last()]">ERROR: xforms-link-error !</setvalue> </action> Or: <instance id="log"> <log xmlns=""> <message level="" time=""/> </log> </instance> <action ev:event="xforms-link-error"> <insert ref="instance('log')/message"/> <setvalue ref="instance('log')/message[last()]">xforms-link-error</setvalue> <setvalue ref="instance('log')/message[last()]/@level">error</setvalue> <setvalue ref="instance('log')/message[last()]/@time" value="now()"/> </action> Steven On Mon, 21 Jan 2019 11:06:42 +0100, <iturcan@drake.sk> wrote: > > Hello, > > > How can I write some specific behavior for logging with xform technology > ? > > > For example xforms-link-error is called when model instance loading > fails. But how is possible to add some user custom log message ? I see > there is action >message, but it allow me only show message as > modal/modeless/ephemeral. All of these except modal are usable just > when form is rendered. > > Could be possible to add some specific value for attribute Level of > message element, for example: > > > <xf:message level="logger" ev:event="xforms-link-error">ERROR: > xforms-link-error !</xf:message> > > > Or better specific for type of logging: > > > <xf:message level="logger-info" ev:event=" > xforms-model-construct-done">INFO: xforms-model-construct-done > </xf:message> > > <xf:message level="logger-wrn" ev:event=" xforms-model-construct-done" > if=”….some specified condition…”>WARN: some specific problem could > be…</>xf:message> > > <xf:message level="logger-err" ev:event="xforms-link-error">ERROR: > xforms-link-error !</xf:message> > > > I would like avoid javascript call within an action. > > > Rgds, > > > Ivan > > > >
Received on Tuesday, 29 January 2019 16:22:59 UTC