class SupervisorEventListener:
    def __init__(self, url, user, log, event_levels=None):
        self.stdin = sys.stdin
        self.stdout = sys.stdout
        self.stderr = sys.stderr
        self.event_levels = event_levels or DEFAULT_EVENT_LEVELS
        self.log = Logger(url, user, log)

    def runforever(self):
        while 1:
            headers, payload = childutils.listener.wait(self.stdin, self.stdout)
            event = headers['eventname']
            level = self.event_levels.get(event)
            if level:
                self.log.log(level, payload, type='supervisor', event=event)
            childutils.listener.ok(self.stdout)
Exemplo n.º 2
0
class SupervisorEventListener:
    def __init__(self, url, user, log, event_levels=None):
        self.stdin = sys.stdin
        self.stdout = sys.stdout
        self.stderr = sys.stderr
        self.event_levels = event_levels or DEFAULT_EVENT_LEVELS
        self.log = Logger(url, user, log)

    def runforever(self):
        while 1:
            headers, payload = childutils.listener.wait(
                self.stdin, self.stdout)
            event = headers['eventname']
            level = self.event_levels.get(event)
            if level:
                self.log.log(level, payload, type='supervisor', event=event)
            childutils.listener.ok(self.stdout)
Exemplo n.º 3
0
 def __init__(self, url, user, log, event_levels=None):
     self.stdin = sys.stdin
     self.stdout = sys.stdout
     self.stderr = sys.stderr
     self.event_levels = event_levels or DEFAULT_EVENT_LEVELS
     self.log = Logger(url, user, log)
 def __init__(self, url, user, log, event_levels=None):
     self.stdin = sys.stdin
     self.stdout = sys.stdout
     self.stderr = sys.stderr
     self.event_levels = event_levels or DEFAULT_EVENT_LEVELS
     self.log = Logger(url, user, log)