Vinay Sajip added the comment:
Loggers don't deal with output - handlers do - so I would prefer not to add an
output-related method to a logger: people confuse the two enough as it is. Note
that
stream = LoggerWriter('foo')
gives an equivalent result to
stream = getLogger('foo').debug_printer()
and in my view the former is preferable.
I agree that there is no compelling reason to replace sys.stdout, though it
means that you have to pass file=stream in each print() call.
It also makes more sense to use print() rather than have a separate API that
looks just like print(), as you essentially would have to duplicate the
functionality of the print() API and track enhancements to it over time (to
avoid surprises).
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue22195>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com