95 log_handler = GZipLog(log_file=args.log)
97 def sigusr1_handle(*kargs, **kwargs):
98 log_handler._sigusr_interrupt =
True 100 log_handler.flush_block()
102 signal.signal(signal.SIGUSR1, sigusr1_handle)
107 log_handler._sigusr_interrupt =
False 108 rlist, wlist, xlist = select.select([fd], [], [], 5)
109 except select.error
as e:
110 if e[0] != errno.EINTR:
raise 111 if not log_handler._sigusr_interrupt:
raise 116 log_handler.handle_timeout()
119 bytes = os.read(fd, 4096)
123 log_handler.write(bytes)
125 sys.stdout.write(bytes)