In urllib2
how can I redirect the output a particular opener generates when I specify the debuglevel
parameter?
E.g. for this example
opener = urllib2.build_opener(urllib2.HTTPHandler(debuglevel=2))
opener.open("http://stackoverflow.com")
how would I catch the output in an "object" similar to sys.stderr
and be able to write it anywhere I like?
I have a script that uses logging and stderr
and this particular output should go to the log without hampering any of the other output.