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 Fri, 20 Aug 2004 12:24:10 GMT
I suspect you are thinking in an "old fashion" way where log levels are 
determined by #defines at preprocessing time. Log4cxx does this based on 
configuration file settings. 
If you look at the logging macros you'll see: 

if (logger->isEnabledFor(level)) { 
... 
} 

This way, the desired log level is set at runtime without a need for 
recompiling (or even having access to) the source code. Of course, there 
is a small performance price to pay. 

Alex 

Mattias Brändström <thebrasse@brasse.org> wrote on 08/20/2004 04:37:47 AM:

> Hello!
> 
> I was looking at the logging macros in log4cxx and I have one question. 
> Is there any particular reason why the macros aren't enclosed in an #if 
> like this:
> 
> #if !defined(LOG4CXX_DISABLE_DEBUG)
> 
> macro definition here
> 
> #endif
> 
> I suspect that there is a reason for this, I just can't figure it out on 

> my own. :-) So please enlighten me.
> 
> :.:: mattias

Mime
View raw message