[asterisk-dev] Janitor Project - ast_debug() conversion

Michael Neuhauser mike at firmix.at
Tue Jun 12 12:53:02 CDT 2007


On Tue, 2007-06-12 at 11:18 -0500, Russell Bryant wrote:
> Currently, you will see code like:
> 
> if (option_debug)
>     ast_log(LOG_DEBUG, ...);
> 
> if (option debug > 3)
>     ast_log(LOG_DEBUG, ...);
> 
> Now, that would look like
> 
> ast_debug(1, ...);
>
> ast_debug(3, ...);

Shouldn't this be ast_debug(4, ...) since ast_debug(level, ...) checks
for option_debug >= level?

(It also may be a good idea to put parenthesis around "level" in the
macro definition, i.e., "if (option_debug >= (level))" - who knows what
complex expressions are passed for level ...)
-- 
Dr. Michael Neuhauser                              mailto:mike at firmix.at
Firmix Software GmbH                                  sip:mike at firmix.at
Vienna/Austria/Europe                               tel:+43-1-7890849-30
Linux Development and Services                     http://www.firmix.at/



More information about the asterisk-dev mailing list