Fixed a UnicodeDecodeError at logging strings containing backslashes.