def abbreviate_str(string, max_len=80, indicator='...'):
    """
  Abbreviate a string, adding an indicator like an ellipsis if required.
  """
    if not string or not max_len or len(string) <= max_len:
        return string
    elif max_len <= len(indicator):
        return string[0:max_len]
    else:
        return string[0:max_len - len(indicator)] + indicator
