[mythtv-users] Messages from system to user

Matt White whitem at arts.usask.ca
Tue Jan 6 23:39:25 EST 2004


Isaac Richards wrote:
> On Tuesday 06 January 2004 12:12 am, Kevin Kuphal wrote:
> 
>>Certainly.  I expected though that this would be only for items that were
>>important enough to notify the user of.  Things that ultimately might
>>require user attention.  For example, the ReplayTV only gives me messages
>>if an update is missed, power is lost (i.e., reset), or if phone numbers
>>have changed.  While we might have more possible notification points, I
>>wouldn't expect this to be used to generate lots of satisfactory messages
>>or even marginal messages but rather for important "you should pay
>>attention to this" items.
>>
>>Any thoughts on whether this would be a module unto itself or something
>>embedded in the core?
> 
> 
> Add on module, I'd think.  

This struck me as something that I'd like to see.  It would be very nice
for non-technical users to be able to check on the status - when I get
my parent's MythBox set up, for example.

I've started doing a bit of work, but I wanted to run it by the group to
get opinions/comments/flames/etc.

As Isaac says, I'm thinking an add-on module for the display of the
notices; however, the actual logging would have to be embedded in the
actual programs/libraries.

I've modelled it somewhat after syslog, but logged to the database.  I
created a mythlog table:

+--------------+--------------+------+-----+---------+-------+
| Field        | Type         | Null | Key | Default | Extra |
+--------------+--------------+------+-----+---------+-------+
| module       | varchar(32)  |      |     |         |       |
| priority     | int(11)      | YES  |     | NULL    |       |
| acknowledged | tinyint(1)   | YES  |     | 0       |       |
| logdate      | date         | YES  |     | NULL    |       |
| logtime      | time         | YES  |     | NULL    |       |
| host         | varchar(128) | YES  |     | NULL    |       |
| message      | varchar(255) |      |     |         |       |
| details      | text         | YES  |     | NULL    |       |
+--------------+--------------+------+-----+---------+-------+

Module is the name of the program or module that is reporting the
message (ie. mythbackend, mythfilldatabase, etc).  Priority is
like the syslog priorities (debug, info, warning, etc), with a
view to being able to view only messages of a certain priority
and above.  Acknowleged is a boolean - once a message has been
acknowleged, it won't be displayed again.  Date, time, and host
are self-explanatory.  Message is a "summary" one-line message,
suitable for display in a list, and details is a longer
description of the entry (if needed).

I tossed a call into MythContext to make a log entry, again
similar to syslog:

   void LogEntry(const QString &module, int priority,
                 const QString &message, const QString &details = "");

So, a simple log entry might be:

gContext->LogEntry("mythbackend",LP_INFO,"MythBackend starting");

Obviously, some work would have to be done on each package to
insert calls to log various operations.

For a frontend interface, I'm thinking about a list view showing
the unacknowleged messages (date/time/message), with details being
shown (in an area at the bottom of the screen) when a particular
message is selected.  It would also include either a spinbox for
selecting the min priority to view or else press 1-x to select
the min priority.  I'm also thinking about prompting to acknowlege
all messages when you exit the interface.

It could be integrated into MythWeb, as well.

How does this sound?  I've got the logging stuff done (it's really
pretty simple) and a couple of samples put into the various programs,
but I don't want to start on the interface until I'm sure it'll
be useful...

-- 
Matt White                          whitem at arts.usask.ca
Arts and Science Computer Labs      University of Saskatchewan



More information about the mythtv-users mailing list