On Aug 5, 2004, at 10:58, Aditya Athalye wrote:

U shld use a flag say debug.

so the code will look like

boolean debug = true;

if(debug)

System.out.println(" .... ");

In production make the flag as false.

Just out of curiosity.

I see that pattern often, and find that "if" for every single debug message clutters the source code unnecessarily. I just put the "if" in the dubug function and gain readability and lines at the price of a method call.

Is that "if" around logging calls a measured, conscious choice? Or it is just you can't psychologically stand an unnecessary call? Even if the block was optimized out by the compiler the price of the extra lines all over the source tree looks too expensive to me in the context a web application. Should I revise this?

-- fxn


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to