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

Subject: Re: [xsl] Managing debug logging in complex transforms: what do people do?
From: davep <davep@xxxxxxxxxxxxx>
Date: Tue, 25 Mar 2014 09:18:52 +0000
On Mon, 24 Mar 2014 12:31:07 -0500
Eliot Kimber <ekimber@xxxxxxxxxxxx> 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.:


> 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.


> bbbbb
> Eliot Kimber, Owner
> Contrext, LLC



Dave Pawson

Current Thread