Hello,
I have this code:
s = smtplib.SMTP()
s.set_debugleve l(1)
s.connect(host= smtp_host)
s.set_debugleve l(0)
log("Connected, sending e-mail")
sys.stdout.flus h()
s.sendmail(
consts.EMAIL_FR OMADDRESS,
[to],
msg.as_string()
)
log("E-mail sent OK")
s.quit()
The problem is that whenever I set the debuglevel to 1, messages will go
to stderr. I would like them to go to stdout. Using
sys.stderr = sys.stdout
has no effect. Redirecting stderr to stdout from the shell is not an
option for me, because I need to use stderr for other messages.
Thanks,
Les
Comment