~stefanor/ibid/timeout-344882

« back to all changes in this revision

Viewing changes to ibid/core.py

  • Committer: Jonathan Hitchcock
  • Date: 2009-03-16 17:05:45 UTC
  • mfrom: (573.1.2 no-clock-logging)
  • Revision ID: jonathan@vhata.net-20090316170545-xw1br9m3g7agsoh2
Stop clock source flooding the logs
https://code.edge.launchpad.net/~stefanor/ibid/no-clock-logging/+merge/4486

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
                self.log.exception(u"Exception occured in %s processor of %s plugin", processor.__class__.__name__, processor.name)
24
24
                event.complain = 'exception'
25
25
 
26
 
        self.log.debug(event)
 
26
        log_level = logging.DEBUG
 
27
        if event.type == u'clock' and not event.processed:
 
28
            log_level -= 5
 
29
        self.log.log(log_level, event)
27
30
 
28
31
        filtered = []
29
32
        for response in event['responses']:
34
37
                self.send(response)
35
38
 
36
39
        event.responses = filtered
37
 
        self.log.debug(u"Returning event to %s source", event.source)
 
40
        self.log.log(log_level, u"Returning event to %s source", event.source)
 
41
 
38
42
        return event
39
43
 
40
44
    def send(self, response):
46
50
            self.log.warning(u'Received response for invalid source %s: %s', response['source'], response['reply'])
47
51
        
48
52
    def dispatch(self, event):
49
 
        self.log.debug(u"Received event from %s source", event.source)
 
53
        log_level = logging.DEBUG
 
54
        if event.type == u'clock':
 
55
            log_level -= 5
 
56
        self.log.log(log_level, u"Received event from %s source", event.source)
 
57
 
50
58
        return threads.deferToThread(self._process, event)
51
59
 
52
60
class Reloader(object):