Correct logging usage for python 2.7 (might break in 2.6)