/I am not asking about parametized messages.
I know I can write:
// Code A:
/

     if(logger.isDebugEnabled() {
       logger.debug("Entry number: " + i + " is " + String.valueOf(entry[i]));
     }


What I want is something like this code in log4j public void chechDebug(String1, String2..... ) {

   if(this.isDebugEnabled() {
       this.debug("Entry number: " + String2 + " is " + 
String.valueOf(entry[i]));
     }

}

This way code in A: is same as:

logger.chechDebug("Entry number: " + i + " is " + String.valueOf(entry[i]));

and it's a lot more redable. I tell you a lot of programers, including me, write a log wraper to do this. It's a LOT more readable.

It be great if the new version we do not have to do this. Hopefully I explained better. Like some kind of a pre-processor.

.V



Ceki Gülcü wrote:


Log4j 1.3alpha implements parameterized messages.

Please see http://logging.apache.org/log4j/docs/faq.html#2.3

UGLI also supports parameterized messages. Please see
http://logging.apache.org/log4j/docs/ugli.html

I hope this helps,

At 02:28 PM 1/20/2005, [EMAIL PROTECTED] wrote:

I do think the if statements guarding code tends to help obfuscate the code.

There has been an issue suggesting a less messy way from the log4j
users perspective -
http://issues.apache.org/bugzilla/show_bug.cgi?id=16229

Doesn't work for all cases but I think it will make a lot of code
using log4j a lot cleaner. This has been marked as fixed. So is it in
a forthcoming release?

Bob.




--
RiA-SoA w/JDNC <http://www.SandraSF.com> forums
- help develop a community
My blog <http://www.sandrasf.com/adminBlog>


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



Reply via email to