I found a better way to set up the logger in child processes, thanks to StackOverflow! I now call worker-configurer at the beginning of each pool process, but the configurer checks for existing logger handlers:
`def worker_configurer(queue):
root = logging.getLogger()
if not root.handlers:
h = QueueHandler(queue)
root.addHandler(h)
root.setLevel(logging.DEBUG)
return
`
No more need for os checking and artificial time delays!
No comments:
Post a Comment