def handle(self):
"""Deal with the incoming log data"""
while True:
chunk = self.connection.recv(4)
if len(chunk) < 4:
break
struct_len = struct.unpack('>L', chunk)[0]
chunk = self.connection.recv(struct_len)
while len(chunk) < struct_len:
chunk = chunk + self.connection.recv(struct_len - len(chunk))
obj = self.unpickle(chunk)
record = logging.makeLogRecord(obj)
self.handle_log_record(record)
评论列表
文章目录