Alan McAuley wrote:
> 
> >
> > // creates new String objects only if Log is logging
> > if (Log.isLogging()) {
> >   Log.note("SimpleTransform:  transforming url: " + url +
> >            " with stylesheet: " + stylesheet_url );
> > }
> >
> 
> What about centralising the "isLogging" code to the Log class itself. The
> above is quite cumbersome really. So the Log class is centrally
> enabled/disabled. Log.note would then make the check to see if logging is
> enabled..... Ive done something similar before (havent we all!) - have a flag
> in a properties file to enable/disable logging when first initialised.
> 

If you want to disable debugging for performance reason, you don't want to generate
the debug string because String manipulation is expensive in Java, so it makes
sense from a performance point of view to use the construct Thomas proposed 
rather than filtering at the Log class level.

--
Raphaël Luta - [EMAIL PROTECTED]
Vivendi Universal Networks - Services Manager / Paris


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/[email protected]/>
List Help?:          [EMAIL PROTECTED]

Reply via email to