[mythtv-commits] 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

Log:

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)
  --nodblog
  --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.

Modified:

   mythtv/bindings/python/MythTV/_conn_mysqldb.py
   mythtv/bindings/python/MythTV/_conn_oursql.py
   mythtv/bindings/python/MythTV/connections.py
   mythtv/bindings/python/MythTV/database.py
   mythtv/bindings/python/MythTV/logging.py
   mythtv/bindings/python/MythTV/methodheap.py
   mythtv/bindings/python/MythTV/mythproto.py
   mythtv/bindings/python/MythTV/static.py
   mythtv/bindings/python/MythTV/system.py
   mythtv/bindings/python/MythTV/utility.py



More information about the mythtv-commits mailing list