cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Turner <>
Subject Re: AbstractSAXTransformer logging (Re: cvs commit: ...
Date Wed, 18 Jun 2003 22:35:34 GMT
Carsten Ziegeler wrote:
> Jeff Turner wrote:
>>I'm not too sure of this commit.  The problem is that
>>debug-level logging is so verbose that it swamps the debug logs
>>of its children
>>with stuff like this:
>>DEBUG   (/forrest/body-index.html): BEGIN endTransformingElement
>>uri=, name=link, raw=link)
>>DEBUG   (/forrest/body-index.html): END endTransformingElement
>>DEBUG   (/forrest/body-index.html): BEGIN endTransformingElement
>>uri=, name=p, raw=p)
>>DEBUG   (/forrest/body-index.html): END endTransformingElement
>>Simplest solution would be to just remove those debug() statements.
>>However, assuming these logs are useful to someone, I've added a
>>flag to switch
>>them on/off (left on by default).  The flag is declared 'final' and can be
>>switched off with the protected constructor added for this purpose.
>>Advice welcome.
> I like this idea, but how can you turn this off? The default constructor
> is automatically called by avalon.

By declaring a no-args constructor in subclasses:

public MyTransformer() {

> PS: I have no objection in making "off" the default.

Hmm.. if 'off' should be the default, then I think it would be best just 
to remove the debug() calls. It saves some complexity, and it's almost 
as easy to add the debug() calls by hand than to switch the flag in a 
constructor. Logging SAX events is best done with the LogTransformer anyway.

I'll do this tonight if there's no objections.


> Carsten

View raw message