[mythtv] [mythtv-commits] mythtv/master commit: ad8b03b3a by Gavin Hurlbut (Beirdo)

Gavin Hurlbut gjhurlbu at gmail.com
Wed Jun 8 05:33:42 UTC 2011

2011/6/7 MythTV <noreply at mythtv.org>

>      Author:  Gavin Hurlbut <ghurlbut at mythtv.org>
>  Change Date:  2011-06-07T22:07:58-07:00
>   Push Date:  2011/06/07 22:08:51 -0700
>  Repository:  mythtv
>      Branch:  master
> New Revision:  ad8b03b3a83945119ac43b4714cc0782c2abf6cf
>   Changeset:  https://github.com/MythTV/mythtv/commit/ad8b03b3a
> Log:
> Merge branch 'new-logging'

You will absolutely want/need to do make uninstall then make distclean
before building this.

As a synopsis:

The old db logging is gone.  Logging using VERBOSE is now done
asynchronously with minimal locking in the thread sending the message (just
enough to protect the QQueue).  All log message details are put into a
structure, the pointer of which is queued for logging.  The logging thread
then dequeues and actually writes to the logfile(s), database, and/or

Logging can be (and by default is) done to: console, debug logfile (similar
to our old logs), database table and syslog (defaults to LOCAL7).

To disable each...
console:  --quiet
debug logfile: put no --logfile/--logpath/-l argument
database table: --nodblog
syslog: --syslog none

The debug logfile now also contains extra detail.  In particular, for each
log message, the function, filename and line number of the VERBOSE call, and
the name of the calling thread are added.  This will aid in the debugging of
the codebase as now we can narrow down far easier what precisely is logged
and from where.  The downside is that each and every thread now requires a
threadRegister("thread name") and threadDeregister() call.  I have added to
every thread I've found (almost 100 in total!).  If the thread is not
registered, the logs will show "thread_unknown" instead.

A minor change to the use of VERBOSE:  Please no longer use
VERBOSE(VB_LEVEL, string << value << string);  This will not compile.  I
converted every single one of these to a working equivalent.  The second
argument is a QString, not a QStringList.  The use of string + string works,
as does QString("blah %1").arg(blah).  To print a pointer, the best way is:
 QString("0x%1").arg((uint64_t)pointer,0,16)  -- these have also all been
converted.  If I missed some, sorry. :)

Please note that --logpath now exists.  If --logfile/--logpath/-l is given
an argument of a directory, then the debug logfile will be created in that
directory as (for example) mythfrontend.pid.log (fill in the pid number).
 If it is given an argument of a file (i.e. non-directory), then that will
be used as the filename of the debug log.  There are probably a few places
where the directory could be propagated into system calls, but aren't yet.

SIGHUP will close and reopen the debug logfile, for the benefit of those
using logrollers.

Finally, the command line parsing has been completely reworked by Raymond
Wagner (and some follow up tweaks by myself).  All binaries (except
mythzmserver, I think) use the new command-line parsers, and all use the new
logging as well.

If there are issues, by all means, let me know (via email, trac tickets, on
IRC, whatever).  This has been a long haul, and there are still things to be
done (such as converting some cout and cerr uses to VERBOSE to use the new
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.mythtv.org/pipermail/mythtv-dev/attachments/20110607/9353796b/attachment.html 

More information about the mythtv-dev mailing list