[mythtv-firehose] mythtv/master commit: 8237a25f9 by Raymond Wagner (wagnerrp)

MythTV noreply at mythtv.org
Sun Oct 23 22:07:56 UTC 2011

      Author:  Raymond Wagner <rwagner at mythtv.org>
 Change Date:  2011-10-23T15:07:20-07:00
   Push Date:  2011/10/23 15:07:43 -0700
  Repository:  mythtv
      Branch:  master
New Revision:  8237a25f9466262743c75b3c0a9f77a77c978ce0
   Changeset:  https://github.com/MythTV/mythtv/commit/8237a25f9


Update Python logging interface to match changes to internal logging

This commit reworks the MythLog class in the python bindings to follow
suit with the logging interface in MythTV. This brings syslog and
database logging, as well as automatic parsing of the assorted command
line arguments used for it

The big change, and one that will break any existing user of the logging
interface, is the addition of a new argument to the log() method, and in
turn the __call__ shortcut. In addition to the previous bitwise mask,
there is now a level, using the standard syslog filtering levels. All
calls to such methods must be updated to specify a log level.

The existing _setlevel and _parselevel methods have been renamed to
_setmask and _parsemask, respectively. In addition, there are two more
methods, _setlevel and _setsyslog, to control the filter and output.

The first time the MythLog class is touched, it will read through the
given command line arguments and parse out any of the following to
automatically configure itself:
  --quiet (can be used multiple times for increased effect)
  --loglevel <integer or string>
  --verbose  <bitwise or comma-deliminated string>
  --logfile  <string>
  --logpath  <string>
  --syslog   <facility>
If providing your own command line parsing, make sure to allow these to
be accepted by the parser. If writing a task as a user job, any and all
of these may be provided by using the %VERBOSEMODE% tag.



More information about the mythtv-firehose mailing list