[asterisk-bugs] [Asterisk 0017062]: Meaningless extension warnings logging

Asterisk Bug Tracker noreply at bugs.digium.com
Tue Mar 23 09:11:36 CDT 2010


The following issue has been UPDATED. 
====================================================================== 
https://issues.asterisk.org/view.php?id=17062 
====================================================================== 
Reported By:                drookie
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   17062
Category:                   Resources/res_config_pgsql
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     acknowledged
Asterisk Version:           1.6.0.26 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2010-03-20 02:52 CDT
Last Modified:              2010-03-23 09:11 CDT
====================================================================== 
Summary:                    Meaningless extension warnings logging
Description: 
res_config_pgsql.c reports unneeded and redundant logging around line 353.
The code looks like

===Cut===
if ((num_rows = PQntuples(result)) > 0) {
  ast_debug(1, "PostgreSQL RealTime: Found %d rows.\n", num_rows);
  [...]
} else {
   ast_log(LOG_WARNING, "PostgreSQL RealTime: Could not find any rows in
table %s.\n", table);
}
===Cut===

in 1.4.x branch the cose looks even more evidently weird:

===Cut===
if ((num_rows = PQntuples(result)) > 0) {
  ast_log(LOG_DEBUG, "Postgresql RealTime: Found %d rows.\n", num_rows);
} else {
  ast_log(LOG_WARNING, "Postgresql RealTime: Could not find any rows in
table %s.\n", table);
}
===Cut===

Thus, in both branch, the condition positive branch has LOG_DEBUG
priority, and condition negative branch has LOG_WARNING priority. I think
this is completely wrong, because most of the time, like 99% of time
(actually I think this is 100% of time, but may be I'm missing this 1% of
reporting where this message is needed) those messages have no sense,
because in extension table there's no such extensions really. Furthermore,
when this is really an error, asterisk shows really meaningful message
about a call that is being sent into the invalid extension. So, most of the
time those lines are just flooding the console, interfering with really
meaningful messages, and if 'logger mute' is issued, those meaningful
messages are blocked too.

I think the condition negative branch has to be corrected to
ast_debug/LOG_DEBUG clause, which I'm actually doing by myself on my
asterisk production sites.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-03-23 09:11 lmadsen        Description Updated                          
======================================================================




More information about the asterisk-bugs mailing list