On Mon, 5 Sep 2005, Martin Blais wrote: > However, there is an easy way out: hijack sys.stdout to forward to > your logger system. > I've got a web application framework that's setup like that right now, > it works great (if you will not need the original print-to-stdout > anymore in your program, that is). I print, it goes to the logfile. > You just have to be careful where--in time-- you replace sys.stdout. Sure, and indeed I've done that often enough but it's kind of ugly and doesn't help if you merge bodies of code where some stuff should go to a log, some to stdout, some elsewhere. Hmm, maybe I'd end up avoiding the builtin print() as well, or at least need to pass around the stream where I want output. The general problem of not tying code to a particular output stream is what I'm reacting to. - Stephan
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4