[mythtv-commits] Ticket #6237: Enable mythfrontend --logfile logging early to get all info into log file
MythTV
mythtv at cvs.mythtv.org
Fri Feb 6 23:57:45 UTC 2009
#6237: Enable mythfrontend --logfile logging early to get all info into log file
----------------------------------------------+-----------------------------
Reporter: sphery <mtdean at thirdcontact.com> | Owner: ijr
Type: patch | Status: new
Priority: minor | Milestone: unknown
Component: MythTV - General | Version: head
Severity: medium | Mlocked: 0
----------------------------------------------+-----------------------------
In mythfrontend, the arg processing functionality waits until after the
creation of MythContext to parse the --logfile option. Therefore, the
following information is output to stdout, rather than the logfile:
{{{
2009-02-06 18:21:59.425 mythfrontend version: trunk [19949] www.mythtv.org
2009-02-06 18:21:59.427 Using runtime prefix = /usr/local
2009-02-06 18:22:00.230 Empty LocalHostName.
2009-02-06 18:22:00.230 Using localhost value of mythhostname
2009-02-06 18:22:00.244 New DB connection, total: 1
2009-02-06 18:22:00.248 Connected to database 'mythconverg' at host:
localhost
2009-02-06 18:22:00.250 Closing DB connection named 'DBManager0'
2009-02-06 18:22:00.380 ScreenSaverX11Private: XScreenSaver support
enabled
2009-02-06 18:22:00.382 DPMS is active.
2009-02-06 18:22:00.387 Primary screen: 0.
2009-02-06 18:22:00.388 Connected to database 'mythconverg' at host:
localhost
2009-02-06 18:22:00.390 Using screen 0, 1920x1200 at 0,0
2009-02-06 18:22:00.410 MythUI Image Cache size set to 20971520 bytes
}}}
After this point, VERBOSE output is written to the logfile, starting with:
{{{
2009-02-06 18:22:00.411 Enabled verbose msgs: important general
}}}
meaning that useful diagnostic information such as the version and runtime
prefix and hostname are not included in the logfile.
The attached patch simply rearranges the arg processing to parse the
--logfile argument and open the logfile, when appropriate, before the
creation of MythContext.
The "mythfrontend version" line of code is actually duplicated in the
conditional verifying successful opening of the logfile, since the one
that occurs before the argument processing is used for --help, so couldn't
be moved after arg processing. The extra line of code only executes when
--logfile is used, meaning that the version information will be printed
once on stderr and once in the log file.
Much of the benefit of this patch comes from the fact that the log file
will contain the version information, making it easier to diagnose
reported problems.
--
Ticket URL: <http://svn.mythtv.org/trac/ticket/6237>
MythTV <http://www.mythtv.org/>
MythTV
More information about the mythtv-commits
mailing list