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)
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)
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)