[asterisk-dev] logging improvements

Paul Hewlett paul at gccs.co.za
Thu Jun 7 03:16:38 MST 2007


On Thursday 07 June 2007 01:01, Dmitry Andrianov wrote:
> Hello, list.
>
> I briefly discussed with Russell Bryant why there is a need for "if
> (options_debug)" check before each "ast_log(LOG_DEBUG, " when this check
> can be a part of the function itself like in most of logging frameworks
> and he told me that yes, it needs to be improved some day. And ideally,
> check should be done at macro level to avoid expensive (?) call to a
> function.
>
>
>
> Attached quick "proof of concept" application demonstrating the approach
> can be used
>
> There are two things to note:
>
> 1.       We depend on compiler's support for var-arg defines. GCC does
> support them but I do not know what are target compilers for Asterisk
> nor will you accept such a dependency or not.
>
C99 defines a standard way of doing var-args in macros. The syntax is 
different to gcc but in principle should be portable to other compilers

Paul

-- 
Paul Hewlett  Technical Director 
Global Call Center Solutions Ltd, 2nd Floor, Milnerton Mall
Cnr Loxton & Koeberg Roads, 7435 Milnerton
www.gccs.co.za
Tel: +27 86 111 3433 Fax: +27 86 111 3520 Cel: +27 76 072 7906
Gizmo: 1 747 659 6171



More information about the asterisk-dev mailing list