def crop_string_middle(s, length=32, cropper='...'):
    """Crops string by adding ... in the middle.

    Args:
        s: String.
        length: Length to crop to.

    Returns:
        Cropped string
    """
    if len(s) <= length:
        return s
    half = (length - len(cropper)) // 2
    return s[:half] + cropper + s[-half - 1:]
