Everywhere you're using "debug" and print statements seems like a reasonable place to pass in a Python logger object. Instantiate it with the correct level and index in the worker process and then pass that around? You can even add the worker index to the logging format so that doesn't have to be passed around. Although I totally understand that there might be secret hell in getting that to work... multiprocessing and logging is tricky. Feel free to leave as is if you want.