def pretty_path(path):
    """ Prettify path for logging.
    """
    path = fmt.to_utf8(path)
    home_dir = os.path.expanduser("~")
    if path.startswith(home_dir):
        path = "~" + path[len(home_dir):]
    return '"%s"' % (path,)
Prettify path for logging.