Fix logging with print(unicode(...))

Requires some hackery of the "Are we python 3?" variety. Basically, if unicode
is not defined, we must be in Python3, so redefine it as the desirable
function.