Just use ast_debug(LEVEL, ...) instead of ast_log(LOG_DEBUG, ...) and it will 
check debug level automatically.
This however applies only to trunk / 1.6 - if you are using 1.4, you have to do
if (option_debug) {
        ast_log(LOG_DEBUG, ...)
}

or

if (option_debug > LEVEL) {
        ast_log(LOG_DEBUG, ...)
}

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ed Greenberg
Sent: Monday, January 28, 2008 8:33 PM
To: [email protected]
Subject: [asterisk-dev] (((Getting debug level)))

I am getting debug lines on the console from res_config_mysql.c even
with core set debug 0 or off.

I would like to craft a patch to check the debug level before outputting
these lines.

I've been trying to find an example in the source of how this is
determined with little success.

Can somebody please point me at documentation or examples on how
debugging output is controlled?

Thanks,
</edg>
Ed Greenberg
San Jose, CA

_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev

_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev

Reply via email to