code: def _abbreviate(text, threshold):
    
    if text is not None and len(text) > threshold:
      text = text[:threshold] + "..."
  
    return text
docs: Abbreviate the given text to threshold chars and append an ellipsis if its
    length exceeds threshold; used for logging;
  
    NOTE: the resulting text could be longer than threshold due to the ellipsis