xsl-list
[Top] [All Lists]

Re: [xsl] Managing debug logging in complex transforms: what do people do?

2014-03-25 04:19:11
On Mon, 24 Mar 2014 12:31:07 -0500
Eliot Kimber <ekimber(_at_)contrext(_dot_)com> wrote:

Then I started using a runtime parameter to turn debugging on or off
globally and using IF checks to output my messages. But that results
in a lot of messages when you've got a lot of debug messages, most of
which are not relevant to your current problem, so back to commenting
things out or disabling the IF check (e.g., test="false() and
$doDebug").

Lately I've been trying the technique of using a tunnel parameter to
communicate the debug state to each template or function, which lets
me selectively turn on debugging within a given code path, e.g.:



snip


Because you can shadow a parameter within a template, you can create a
doDebug variable within a template to turn debugging on or off and
that setting will propagate to the descendant templates.

This approach is working well to make it easier for me to control my
debugging dynamically and more easily focus my messaging. But it adds
some overhead to the code in that you need the debug parameter and
with-param everywhere, which isn't that big of a deal to add but
still.

My question: is there a better way to do this? Am I overlooking some
feature of XSLT 2 (or 3) that would make managing debugging messages
easier? Should I step up to a more complete messaging framework that
mirrors e.g., log4j?


Nominal variant on that Eliot.
Set your debug variable to a 'level', I use 1..10
and adjust your volume accordingly.
  Higher number, more output.

HTH DaveP


—————
Eliot Kimber, Owner
Contrext, LLC
http://contrext.com




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--




-- 

regards 

-- 
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--