logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fabijan...@nucorsteel.com
Subject Re: The logging macros
Date Thu, 26 Aug 2004 13:21:03 GMT
Mattias Brändström <thebrasse@brasse.org> wrote on 08/26/2004 09:10:04 AM:

> The reason I was asking about the macros was that I am a little 
> concerned about the performance impact of making the logging calls all 
> the time. I sometimes want to sprinkle my code with debug messages and 
> leave them there. If I can recompile with LOG_DEBUG types macros 
> disabled I won't have to worry about those debug messages stealing 
> resources from the rest of the application. Should I worry about this if 

> I am using log4cxx?

Again, all I can tell you is that all your performance penalty is in the 
following line:

if (logger->isEnabledFor(level))

If you are not willing to pay it at production runtime, you have a choices 
of wrapping your calls into #ifdefs or redefining LOG_DEBUG into nothing 
and have compile time control.

I am not aware of built-in compile time control mechanism with log4cxx.

Alex
Mime
View raw message