Vinay Sajip added the comment: > but still not very elegant. You're also repeating the stream on every > occurrence, so easy to leave it out by mistake.
It might need more work to make a LoggerWriter work with sys.stdout [i.e. allowing sys.stdout = LoggerWriter()], which seems to be the only way to avoid passing a file= each time. I'm not sure that write() and flush() would be sufficient for this - for example, an encoding attribute might be required. Feel free to suggest improvements. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue22195> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com