Bug 5657 - RFE: allow debug areas to be excluded from 'all' debugging
Summary: RFE: allow debug areas to be excluded from 'all' debugging
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Libraries (show other bugs)
Version: SVN Trunk (Latest Devel Version)
Hardware: All All
: P5 enhancement
Target Milestone: 3.3.0
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
: 5162 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-09-25 08:12 UTC by Mark Martinec
Modified: 2009-08-04 17:58 UTC (History)
2 users (show)



Attachment Type Modified Status Actions Submitter/CLA Status
A patch to 3.2.3. patch None Mark Martinec [HasCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Martinec 2007-09-25 08:12:18 UTC
I have noticed that a small change to Logger.pm could allow for a
value in $LOG_SA{facility} to override the 'all' setting, thereby
making it possible to enable 'all' but exclude certain facilities from
logging (e.g. to cut down debug clutter in areas not being investigated).
The change is compatible with existing code and usage, but allows for
example a command like: spamassassin --debug=all,norules,noconfig

I'm submitting a change to trunk, and attaching a patch for a review.
I hope you like it.  Here is an updated documentation to add_facilities():

=item add_facilities(facilities)

  Enable debug logging for specific facilities.  Each facility is the area
  of code to debug.  Facilities can be specified as a hash reference (the
  key names are used), an array reference, an array, or a comma-separated
  scalar string. Facility names are case-sensitive.

  If "all" is listed, then all debug facilities are implicitly enabled,
  except for those explicitly disabled.  A facility name may be preceded
  by a "no" (case-insensitive), which explicitly disables it, overriding
  the "all".  For example: all,norules,noconfig,nodcc.  When facility names
  are given as an ordered list (array or scalar, not a hash), the last entry
  applies, e.g. 'nodcc,dcc,dcc,noddc' is equivalent to 'nodcc'.  Note that
  currently no facility name starts with a "no", it is advised to keep this
  practice with newly added facility names to make life easier.

  Higher priority informational messages that are suitable for logging in
  normal circumstances are available with an area of "info".  Some very
  verbose messages require the facility to be specifically enabled (see
  C<would_log> below).
Comment 1 Mark Martinec 2007-09-25 08:15:41 UTC
Created attachment 4133 [details]
A patch to 3.2.3.

svn -m 'allow debug areas to be excluded from 'all' debugging,
	see RFE 5657' ci
Sending lib/Mail/SpamAssassin/Logger.pm
Committed revision 579292.
Comment 2 Mark Martinec 2007-09-26 05:20:32 UTC
In other words: if a $LOG_SA{facility}{...} setting for a particular
facility (debug area) exists (either true or false), it controls
the logging for that facility. If an explicit entry does not exist,
then a usual fallback to the setting of $LOG_SA{facility}{all}
applies, which again can be true or false.
Comment 3 Michael Parker 2007-11-23 11:37:20 UTC
*** Bug 5162 has been marked as a duplicate of this bug. ***
Comment 4 Mark Martinec 2009-08-04 17:58:40 UTC
Closing, if there are no objections.