Message225412
| Author |
vinay.sajip |
| Recipients |
BreamoreBoy, Saimadhav.Heblikar, barry, numerodix, pitrou, rhettinger, vinay.sajip |
| Date |
2014年08月16日.19:58:14 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1408219094.43.0.46620344686.issue22195@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
> 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. |
|