[Zope-CVS] CVS: Products/Scheduler - Scheduler.py:1.19
Chris McDonough
chrism@zope.com
Sat, 28 Jun 2003 14:24:11 -0400
Update of /cvs-repository/Products/Scheduler
In directory cvs.zope.org:/tmp/cvs-serv7757
Modified Files:
Scheduler.py
Log Message:
Log the id of the scheduler into the LOG header.
=== Products/Scheduler/Scheduler.py 1.18 => 1.19 ===
--- Products/Scheduler/Scheduler.py:1.18 Mon Jun 9 12:11:43 2003
+++ Products/Scheduler/Scheduler.py Sat Jun 28 14:24:11 2003
@@ -156,7 +156,7 @@
interface. When we receive a schedule event, we schedule the
event but we do not actually process the event queue."""
- LOG('Scheduler', BLATHER, 'notify called')
+ LOG('Scheduler (%s)' % self.getId(), BLATHER, 'notify called')
if event is None:
# If event is None, assume that we want to run tasks before
# "now" by turning event into a time.time as of now.
@@ -199,14 +199,15 @@
except:
msg = ('The task %s call failed hard!' %
this_task.getDescription())
- LOG('Scheduler', ERROR, msg, error=sys.exc_info())
+ LOG('Scheduler (%s)' % self.getId(),
+ ERROR, msg, error=sys.exc_info())
continue
if not status: # task may want to reschedule
try:
status = this_task.next() # does it want to reschedule?
msg = 'next returned %s' % str(status)
- LOG('Scheduler', BLATHER, msg)
+ LOG('Scheduler (%s)' % self.getId() , BLATHER, msg)
if not status: # if not, that's ok.
continue
except ConflictError:
@@ -215,7 +216,8 @@
except:
msg = ('The task %s next failed hard!' %
this_task.getDescription())
- LOG('Scheduler', ERROR, msg, error=sys.exc_info())
+ LOG('Scheduler (%s)' % self.getId(), ERROR, msg,
+ error=sys.exc_info())
continue
try:
next_time, next_task = status
@@ -231,7 +233,7 @@
msg = ('The task %s declined to reschedule itself '
'by returning %s from its __call__'
% (this_task.getDescription(), str(status)))
- LOG('Scheduler', BLATHER, msg)
+ LOG('Scheduler (%s)' % self.getId(), BLATHER, msg)
security.declareProtected(VIEW_SCHEDULE_PERM, 'getPendingTasks')
def getPendingTasks(self, when=None):