[asterisk-dev] ast_debug() vs ast_log(LOG_DEBUG, ...) vs ast_log(AST_LOG_DEBUG, ...)

Klaus Darilion klaus.mailinglists at pernau.at
Tue Jan 4 07:39:56 CST 2011


>>> I can't think of any reason ast_log(LOG_DEBUG, ...) should be used
>>> directly.  They should all be converted to ast_debug().
>>
>> I tried reading the code but fail to understand the difference between those two, and why there is this wrapper for DEBUG, but no wrappers for other log levels.
>>
>> It would be great if someone can enlighten me.
>
> Debug in 1.4 was often wrapped with
>
> if (option_debug>  3) {
> 	ast_log(LOG_DEBUG, "Hello Klaus!\n");
> }
>
> With the macro we can simply write
>
> 	ast_debug(3, "Hello again, Klaus\n");
>
>
> A simplification making the code less cluttered.

Thanks Olle and Tilghman, I think I understand now.

regards
Klaus



More information about the asterisk-dev mailing list