Adding logging output to client-side javascript