Summary:ASTERISK-03448: [patch] Add debug level setting to asterisk.conf [options]
Reporter:Olle Johansson (oej)Labels:
Date Opened:2005-02-07 12:43:54.000-0600Date Closed:2008-01-15 15:24:46.000-0600
Versions:Frequency of
Environment:Attachments:( 0) astoption.txt
Description:This changes debug=yes|no to debug=<level>. Yes and no is still supported.
Disclaimer on file.
Comments:By: Christopher L. Wade (clwade) 2005-02-08 11:10:32.000-0600

Might want to change the following a little bit...

+ /* debug level (-v at startup) */
} else if (!strcasecmp(v->name, "debug")) {
- option_debug= ast_true(v->value);
+ option_debug = 0;
+ if (sscanf(v->value, "%d", &option_debug) != 1) {
+ if (!strcasecmp(v->value, "yes")) {
+ option_debug = 1;
+ } else {

The original code 'option_debug= ast_true(v->value);' allows all of the 'yes' look-a-likes to work as well as all of the 'no' look-a-likes.  I would recommend the following...

if (sscanf(v->value, "%d", &option_debug) != 1) {
     option_debug = ast_true(v->value);

shorter, cleaner, 'standards based'...

my $0.02.


By: Olle Johansson (oej) 2005-02-08 12:22:05.000-0600

Guess you are right. I was lazy, took the code from chan_sip...


By: Mark Spencer (markster) 2005-02-08 13:27:33.000-0600

I don't know of anything that uses any checks on the level of debug...  What is the purpose of being able to set it to something other than 0 / 1?

By: Christopher L. Wade (clwade) 2005-02-08 14:08:23.000-0600

why does it matter if nothing currently checks the level?

seriously, this is such a small change - other than the nice additional comments oej added - that it won't hurt anything, why question it?

also, the 'set debug' cli command allows you to set debug to any number >= 0, so one or the other needs to be updated so that they work the same.


ps: mark, no offense ment it questioning your question, just voicing my opinion.

By: Mark Spencer (markster) 2005-02-08 18:13:38.000-0600

Added to CVS, thanks.

By: Russell Bryant (russell) 2005-02-13 17:45:36.000-0600

not included in 1.0 since it's a new feature

By: Digium Subversion (svnbot) 2008-01-15 15:24:46.000-0600

Repository: asterisk
Revision: 4988

U   trunk/asterisk.c

r4988 | markster | 2008-01-15 15:24:45 -0600 (Tue, 15 Jan 2008) | 2 lines

Allow debug level to be more than just binary (bug ASTERISK-3448)