Extracted common code for printing shader and GLProgram error logs.