Fix logging on Python 2.6