Wow. I think you need to add some more comments! Feel free to swear in them :)
47 + if isinstance(sys.stderr.logger.root.handlers[0].stream, WriteProxy):
48 + sys.stderr.logger.root.handlers[0].stream = logging.sys.__stderr__
this bit is the maddest of course. It's only due to celery that even sys.stderr.logger exists, right? When does celery do all this crap? Is it possible that we could get to this point in the code _without_ celery having done it?
Wow. I think you need to add some more comments! Feel free to swear in them :)
47 + if isinstance( sys.stderr. logger. root.handlers[ 0].stream, WriteProxy): logger. root.handlers[ 0].stream = logging. sys.__stderr_ _
48 + sys.stderr.
this bit is the maddest of course. It's only due to celery that even sys.stderr.logger exists, right? When does celery do all this crap? Is it possible that we could get to this point in the code _without_ celery having done it?