Update logger.py

Avoid crash when inputting non-ascii characters with logging enabled.