[Home]

Summary:ASTERISK-15844: [patch] Meaningless extension warnings logging
Reporter:Eugene M. Zheganin (drookie)Labels:
Date Opened:2010-03-20 02:52:54Date Closed:2010-05-26 11:31:38
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Resources/res_config_pgsql
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 20100525__issue17062.diff.txt
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.
Comments:By: Digium Subversion (svnbot) 2010-05-26 11:21:00

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 ASTERISK-15844)
Reported by: drookie
Patches:
      20100525__issue17062.diff.txt uploaded by tilghman (license 14)

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

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

By: Digium Subversion (svnbot) 2010-05-26 11:23:29

Repository: asterisk
Revision: 265923

_U  trunk/
U   trunk/res/res_config_pgsql.c

------------------------------------------------------------------------
r265923 | tilghman | 2010-05-26 11:23:28 -0500 (Wed, 26 May 2010) | 14 lines

Merged revisions 265910 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
 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 ASTERISK-15844)
  Reported by: drookie
  Patches:
        20100525__issue17062.diff.txt uploaded by tilghman (license 14)
........

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

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

By: Digium Subversion (svnbot) 2010-05-26 11:31:37

Repository: asterisk
Revision: 265959

_U  branches/1.6.2/
U   branches/1.6.2/res/res_config_pgsql.c

------------------------------------------------------------------------
r265959 | tilghman | 2010-05-26 11:31:37 -0500 (Wed, 26 May 2010) | 21 lines

Merged revisions 265923 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r265923 | tilghman | 2010-05-26 11:23:28 -0500 (Wed, 26 May 2010) | 14 lines
 
 Merged revisions 265910 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   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 ASTERISK-15844)
    Reported by: drookie
    Patches:
          20100525__issue17062.diff.txt uploaded by tilghman (license 14)
 ........
................

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

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