def shorten(text):
if len(text) >= MAX_DISPLAY_LEN:<EOL><INDENT>text = text[:MAX_DISPLAY_LEN//<NUM_LIT:2>]+"<STR_LIT>"+text[-MAX_DISPLAY_LEN//<NUM_LIT:2>:]<EOL><DEDENT>return text<EOL>
Reduce text length for displaying / logging purposes.