Hi Keith,
I believe it is evaluated, even when tracing is turned off. XQuery dictates
that fn:trace returns the first parameter, so it has to evaluate it. A quick
look at the profile output in cq seems to support that it is evaluated:
xquery version "1.0-ml";
fn:trace(fn:concat("hello", " there"), "goodbye")
when you click profile in cq with or without tracing enabled =>
Profiled 2 expressions in PT0S
location
expression
count
shallow-%
shallow-µs
deep-%
deep-µs
.main: 2
concat("hello", " there")
1
-
0
-
0
.main: 2
trace(concat("hello", " there"), "goodbye")
1
-
0
-
0
hello there
-Danny
From: [email protected]
[mailto:[email protected]] On Behalf Of Keith L. Breinholt
Sent: Thursday, September 17, 2009 9:13 AM
To: [email protected]
Subject: [MarkLogic Dev General] Are Trace parameters evaluated when tracing is
turned off?
Are parameters to fn:trace() evaluated when tracing is turned off? (i.e. Does
the MarkLogic XQuery engine do lazy evaluation of parameters?)
If not, are there user level functions to determine if event tracing is active
and if a trace event exists in the current system? There are admin functions
to retrieve these but are there user level functions? It would be nice to
determine if an event exists and if tracing is enabled before doing lengthy
calculations. (For instance there is a xdmp:log-level() function to determine
what level of logging set to.)
Thanks,
Keith L. Breinholt
ICS Content & Media
[email protected]<mailto:[email protected]>
"Do what you can, with what you have, where you are." Theodore Roosevelt
NOTICE: This email message is for the sole use of the intended recipient(s) and
may contain confidential and privileged information. Any unauthorized review,
use, disclosure or distribution is prohibited. If you are not the intended
recipient, please contact the sender by reply email and destroy all copies of
the original message.
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general