def log_escaped(string):
    """
    Return the escaped input string, for use in log messages.
    """
    return string.replace('\n', ' ').replace('  ', ' ').replace('  ', ' ').\
        replace('  ', ' ')