Trim and remove double spaces from the message before logging it.