@classmethod
def _summarize_text(cls, text, max_len=24):
    """Avoid spamming logs by truncating text."""
    if len(text) > max_len:
        return '{!r} + {} chars'.format(text[:max_len], len(text) - max_len)
    return repr(text)
