Force utf-8 encoding on some logging messages

Even specified encoding in logging.basicConfig, it's still ASCII by
default if there's no UTF-8 characters.
rewrite logging config code, previous codes is not working