def main(): try: from setproctitle import setproctitle setproctitle('aiplog') except: print('no setproctitle') sub = RedisSub() with logbook.NullHandler().applicationbound(): with handle('debug'): with handle('info'): with handle('error'): sub.dispatch_forever()