Beispiel #1
0
 async def forward_logs(self, stream):
     source = "controller({})".format(self.name)
     while True:
         try:
             entry = (await stream.readline())
             if not entry:
                 break
             entry = entry[:-1]
             level, name, message = parse_log_message(entry.decode())
             log_with_name(name, level, message, extra={"source": source})
         except:
             logger.debug("exception in log forwarding", exc_info=True)
             break
     logger.debug("stopped log forwarding of stream %s of %s", stream,
                  self.name)
Beispiel #2
0
 async def forward_logs(self, stream):
     source = "controller({})".format(self.name)
     while True:
         try:
             entry = (await stream.readline())
             if not entry:
                 break
             entry = entry[:-1]
             level, name, message = parse_log_message(entry.decode())
             log_with_name(name, level, message, extra={"source": source})
         except:
             logger.debug("exception in log forwarding", exc_info=True)
             break
     logger.debug("stopped log forwarding of stream %s of %s",
         stream, self.name)
Beispiel #3
0
def log_worker(rid, message):
    level, name, message = parse_log_message(message)
    log_with_name(name,
                  level,
                  message,
                  extra={"source": "worker({})".format(rid)})
Beispiel #4
0
def log_worker(rid, message):
    level, name, message = parse_log_message(message)
    log_with_name(name, level, message,
                  extra={"source": "worker({})".format(rid)})