Curt Arnold <carnold <at> apache.org> writes:

> Should just be:
> 
> if (level == 0) {
>      level == Level::getDebug();
> }
> 
> p.s. your code can be a little more efficient (but deviating from  
> Java style) if written like:
> 
> LoggerPtr logger(log4cxx::Logger::getLogger("some-logger-name"));
> LevelPtr level(logger->getLevel());

Thanks Curt. I actually posted about 3 minutes too soon and answered
my own question in the meantime. I have to call the extra copy
constructor for the LoggerPtr in my code because I have to wrap
the log4cxx code into a generic class (long story).

Would it be better to set a default Level in the log4cxx source
code in case people like me forget that the Level can be NULL ?

Thanks again.





Reply via email to