I'm not sure if it's because sys.stderr.write is faster.
imaplib is much older (it was in Python1.5.2) than the logging module (Python2.3), so perhaps noone has needed to update it to use logging yet
Why does python libs (eg imaplib) does not use logging but use sys.stderr.write?