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 <[EMAIL PROTECTED]> 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
- The logging macros Mattias Br�ndstr�m
- Re: The logging macros FabijanicA
- Re: The logging macros Mattias Br�ndstr�m
- Re: The logging macros FabijanicA
