Summary:ASTERISK-09742: [patch] ast_debug
Reporter:Dmitry Andrianov (dimas)Labels:
Date Opened:2007-06-24 17:27:12Date Closed:2007-07-06 19:18:18
Versions:Frequency of
Environment:Attachments:( 0) 9984-missing.patch
Description:Following http://bugs.digium.com/bug_view_advanced_page.php?bug_id=9984

Some of the changes which were in the patch weren't applied. I'm attaching new patch with outstandind modifications.
Comments:By: Russell Bryant (russell) 2007-06-25 07:43:53

In most of these changes, the check of option_debug is still there.  Could you go ahead and remove them?

if (blahdebug && option_debug)
  ast_log(LOG_DEBUG, ...);

if (blahdebug)
  ast_debug(1, ...);

By: Dmitry Andrianov (dimas) 2007-06-25 07:57:18

Unfortunately I can not. The check is not (blah && option_debug) but rather (blah || option_debug) so message can be logged even when option_debug is zero but blah is set to true.
That is also the reason why I do ast_debug(0, ...) - to make sure message will be logged even is option_debug is zero.

I would commit that patch because it at least does not change behaviour. And then think how to improve logging in rtp.c and similar cases. My original idea was to have

#define DEBUG_LEVEL option_debug

in the logger.h and let .c files to override it like

#define DEBUG_LEVEL (rtpdebug ? 100 : option_debug)

But this is something everybody should agree first - there are other ways to achieve the same...

By: Russell Bryant (russell) 2007-06-25 08:42:08

committed in rev 71557, thanks!