diff --git a/HISTORY b/HISTORY index dfb29656..cb8e7595 100644 --- a/HISTORY +++ b/HISTORY @@ -4443,3 +4443,4 @@ Video Disk Recorder Revision History - Updated the Russian OSD texts (thanks to Oleg Roitburd). - Made cMenuRecordings::GetRecording() 'protected' (suggested by Marius Heidenstecker). - Speeded up cRemux::ScanVideoPacket() (thanks to Reinhard Nissl). +- Enhanced logging EPG event data. diff --git a/epg.c b/epg.c index 15a2b0b0..9141f437 100644 --- a/epg.c +++ b/epg.c @@ -7,7 +7,7 @@ * Original version (as used in VDR before 1.3.0) written by * Robert Schneider and Rolf Hakenes . * - * $Id: epg.c 1.66 2006/03/25 11:43:00 kls Exp $ + * $Id: epg.c 1.67 2006/03/25 12:48:34 kls Exp $ */ #include "epg.h" @@ -157,7 +157,7 @@ void cEvent::SetVersion(uchar Version) void cEvent::SetRunningStatus(int RunningStatus, cChannel *Channel) { if (Channel && runningStatus != RunningStatus && (RunningStatus > SI::RunningStatusNotRunning || runningStatus > SI::RunningStatusUndefined) && Channel->HasTimer()) - isyslog("channel %d (%s) event %s '%s' status %d", Channel->Number(), Channel->Name(), *GetTimeString(), Title(), RunningStatus); + isyslog("channel %d (%s) event %s status %d", Channel->Number(), Channel->Name(), *ToDescr(), RunningStatus); runningStatus = RunningStatus; } @@ -208,6 +208,14 @@ void cEvent::SetSeen(void) seen = time(NULL); } +cString cEvent::ToDescr(void) const +{ + char vpsbuf[64] = ""; + if (Vps()) + sprintf(vpsbuf, "(VPS: %s) ", *GetVpsString()); + return cString::sprintf("%s %s-%s %s'%s'", *GetDateString(), *GetTimeString(), *GetEndTimeString(), vpsbuf, Title()); +} + bool cEvent::HasTimer(void) const { for (cTimer *t = Timers.First(); t; t = Timers.Next(t)) { diff --git a/epg.h b/epg.h index 1def6176..a937ff7d 100644 --- a/epg.h +++ b/epg.h @@ -7,7 +7,7 @@ * Original version (as used in VDR before 1.3.0) written by * Robert Schneider and Rolf Hakenes . * - * $Id: epg.h 1.33 2006/02/26 13:58:57 kls Exp $ + * $Id: epg.h 1.34 2006/03/25 12:39:39 kls Exp $ */ #ifndef __EPG_H @@ -103,6 +103,7 @@ public: void SetDuration(int Duration); void SetVps(time_t Vps); void SetSeen(void); + cString ToDescr(void) const; void Dump(FILE *f, const char *Prefix = "", bool InfoOnly = false) const; bool Parse(char *s); static bool Read(FILE *f, cSchedule *Schedule); diff --git a/timers.c b/timers.c index 93f52f35..6190c15a 100644 --- a/timers.c +++ b/timers.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: timers.c 1.53 2006/03/25 11:41:24 kls Exp $ + * $Id: timers.c 1.54 2006/03/25 12:43:59 kls Exp $ */ #include "timers.h" @@ -492,12 +492,8 @@ void cTimer::SetEventFromSchedule(const cSchedules *Schedules) void cTimer::SetEvent(const cEvent *Event) { if (event != Event) { //XXX TODO check event data, too??? - if (Event) { - char vpsbuf[64] = ""; - if (Event->Vps()) - sprintf(vpsbuf, "(VPS: %s) ", *Event->GetVpsString()); - isyslog("timer %s set to event %s %s-%s %s'%s'", *ToDescr(), *Event->GetDateString(), *Event->GetTimeString(), *Event->GetEndTimeString(), vpsbuf, Event->Title()); - } + if (Event) + isyslog("timer %s set to event %s", *ToDescr(), *Event->ToDescr()); else isyslog("timer %s set to no event", *ToDescr()); event = Event;