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

Asterisk Bug Tracker noreply at bugs.digium.com
Tue May 25 13:35:39 CDT 2010


The following issue is now READY FOR TESTING. 
====================================================================== 
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:                     ready for testing
Asterisk Version:           1.6.2.8-rc1 
JIRA:                       SWP-1128 
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-05-25 13:35 CDT
====================================================================== 
Summary:                    [patch] 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-05-25 13:35 tilghman       Asterisk Version         1.6.0.26 => 1.6.2.8-rc1
2010-05-25 13:35 tilghman       Status                   acknowledged => ready
for testing
2010-05-25 13:35 tilghman       Description Updated                          
======================================================================




More information about the asterisk-bugs mailing list