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

Asterisk Bug Tracker noreply at bugs.digium.com
Wed May 26 11:21:00 CDT 2010


A NOTE has been added to this issue. 
====================================================================== 
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-26 11:21 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.
====================================================================== 

---------------------------------------------------------------------- 
 (0122496) svnbot (reporter) - 2010-05-26 11:21
 https://issues.asterisk.org/view.php?id=17062#c122496 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 265910

U   branches/1.4/res/res_config_pgsql.c

------------------------------------------------------------------------
r265910 | tilghman | 2010-05-26 11:21:00 -0500 (Wed, 26 May 2010) | 7
lines

Not finding rows in the DB does not rise to the level of a warning.

(closes issue https://issues.asterisk.org/view.php?id=17062)
 Reported by: drookie
 Patches: 
       20100525__issue17062.diff.txt uploaded by tilghman (license 14)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=265910 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-05-26 11:21 svnbot         Checkin                                      
2010-05-26 11:21 svnbot         Note Added: 0122496                          
======================================================================




More information about the asterisk-bugs mailing list