{"action":"created","comment":{"url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/pulls/comments/150685906","pull_request_review_id":76267714,"id":150685906,"diff_hunk":"@@ -55,52 +62,47 @@ def foo(a, b, c): return [a, b, c]\n             if response.status_code in retry_status_codes:\n                 response_message = _get_message(response)\n                 retry = True\n-                log_error(\"retrying on status code: %s\" % str(response.status_code), verbose)\n-                log_error(str(response_message))\n+                logger.debug(\"retrying on status code: %s\" % str(response.status_code))\n+                logger.debug(str(response_message)) #TODO: this was originally printed regardless of 'verbose' was that behavior correct?\n                 if (response.status_code == 429) and (wait>10):\n-                    sys.stderr.write('%s...\\n' % response_message)\n-                    sys.stderr.write('Retrying in %i seconds' %wait)\n+                    logger.warning('%s...\\n' % response_message)\n+                    logger.warning('Retrying in %i seconds' %wait)\n                 \n             elif response.status_code not in range(200,299):\n                 ## For all other non 200 messages look for retryable errors in the body or reason field\n                 response_message = _get_message(response)\n                 if any([msg.lower() in response_message.lower() for msg in retry_errors]):\n                     retry = True\n-                    log_error('retrying %s' %response_message, verbose)\n+                    logger.debug('retrying %s' %response_message)\n                 ## special case for message throttling\n                 elif 'Please slow down.  You may send a maximum of 10 message' in response:\n                     retry = True\n                     wait = 16\n-                    log_error(\"retrying \"+ response_message,  verbose)\n+                    logger.debug(\"retrying \"+ response_message)\n \n         # Check if we got a retry-able exception\n         if exc_info is not None:\n             if (exc_info[1].__class__.__name__ in retry_exceptions or\n                 any([msg.lower() in str(exc_info[1]).lower() for msg in retry_errors])):\n                 retry = True\n-                log_error(\"retrying exception: \"+ exc_info[1].__class__.__name__ + str(exc_info[1]), verbose)\n+                logger.debug(\"retrying exception: \"+ exc_info[1].__class__.__name__ + str(exc_info[1]))\n \n         # Wait then retry\n         retries -= 1\n         if retries >= 0 and retry:\n             randomized_wait = wait*random.uniform(0.5,1.5)\n-            log_error(('total wait time {total_wait:5.0f} seconds\\n'\n-                       '... Retrying in {wait:5.1f} seconds...'.format(total_wait=total_wait, wait=randomized_wait)),\n-                       verbose)\n+            logger.debug(('total wait time {total_wait:5.0f} seconds\\n'\n+                       '... Retrying in {wait:5.1f} seconds...'.format(total_wait=total_wait, wait=randomized_wait)))\n             total_wait +=randomized_wait\n             doze(randomized_wait)\n             wait = min(max_wait, wait*back_off)\n             continue\n \n         # Out of retries, re-raise the exception or return the response\n         if exc_info is not None and exc_info[0] is not None:\n-            #import traceback\n-            #traceback.print_exc()\n-            print(exc_info[0])\n-            print(exc_info[1])\n-            print(exc_info[2])\n-            # Re-raise exception, preserving original stack trace\n-            raise exc_info[0](exc_info[1])\n+            logger.debug(\"retries have run out. reraising the exception\\n=================\", exc_info=True)\n+            logger.debug(\"\\n================\\n\")","path":"synapseclient/retry.py","position":94,"original_position":94,"commit_id":"3145b73faa403a7fcef679be8c4f1c14845b0304","original_commit_id":"3145b73faa403a7fcef679be8c4f1c14845b0304","user":{"login":"zimingd","id":8023327,"avatar_url":"https://avatars1.githubusercontent.com/u/8023327?v=4","gravatar_id":"","url":"https://api.github.com/users/zimingd","html_url":"https://github.com/zimingd","followers_url":"https://api.github.com/users/zimingd/followers","following_url":"https://api.github.com/users/zimingd/following{/other_user}","gists_url":"https://api.github.com/users/zimingd/gists{/gist_id}","starred_url":"https://api.github.com/users/zimingd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zimingd/subscriptions","organizations_url":"https://api.github.com/users/zimingd/orgs","repos_url":"https://api.github.com/users/zimingd/repos","events_url":"https://api.github.com/users/zimingd/events{/privacy}","received_events_url":"https://api.github.com/users/zimingd/received_events","type":"User","site_admin":false},"body":"remove =========","created_at":"2017-11-13T22:31:17Z","updated_at":"2017-11-13T22:34:12Z","html_url":"https://github.com/Sage-Bionetworks/synapsePythonClient/pull/489#discussion_r150685906","pull_request_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/pulls/489","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/pulls/comments/150685906"},"html":{"href":"https://github.com/Sage-Bionetworks/synapsePythonClient/pull/489#discussion_r150685906"},"pull_request":{"href":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/pulls/489"}}},"pull_request":{"url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/pulls/489","id":151792307,"html_url":"https://github.com/Sage-Bionetworks/synapsePythonClient/pull/489","diff_url":"https://github.com/Sage-Bionetworks/synapsePythonClient/pull/489.diff","patch_url":"https://github.com/Sage-Bionetworks/synapsePythonClient/pull/489.patch","issue_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/issues/489","number":489,"state":"open","locked":false,"title":"Use the logging module instead of printing directly to stdout and stderr (SYNPY-590)","user":{"login":"zimingd","id":8023327,"avatar_url":"https://avatars1.githubusercontent.com/u/8023327?v=4","gravatar_id":"","url":"https://api.github.com/users/zimingd","html_url":"https://github.com/zimingd","followers_url":"https://api.github.com/users/zimingd/followers","following_url":"https://api.github.com/users/zimingd/following{/other_user}","gists_url":"https://api.github.com/users/zimingd/gists{/gist_id}","starred_url":"https://api.github.com/users/zimingd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zimingd/subscriptions","organizations_url":"https://api.github.com/users/zimingd/orgs","repos_url":"https://api.github.com/users/zimingd/repos","events_url":"https://api.github.com/users/zimingd/events{/privacy}","received_events_url":"https://api.github.com/users/zimingd/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-11-09T23:40:03Z","updated_at":"2017-11-13T22:34:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fd3b1a8d986d3e4590ffac2dfb04281caea80a0d","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/pulls/489/commits","review_comments_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/pulls/489/comments","review_comment_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/issues/489/comments","statuses_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/statuses/3145b73faa403a7fcef679be8c4f1c14845b0304","head":{"label":"zimingd:SYNPY-590","ref":"SYNPY-590","sha":"3145b73faa403a7fcef679be8c4f1c14845b0304","user":{"login":"zimingd","id":8023327,"avatar_url":"https://avatars1.githubusercontent.com/u/8023327?v=4","gravatar_id":"","url":"https://api.github.com/users/zimingd","html_url":"https://github.com/zimingd","followers_url":"https://api.github.com/users/zimingd/followers","following_url":"https://api.github.com/users/zimingd/following{/other_user}","gists_url":"https://api.github.com/users/zimingd/gists{/gist_id}","starred_url":"https://api.github.com/users/zimingd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zimingd/subscriptions","organizations_url":"https://api.github.com/users/zimingd/orgs","repos_url":"https://api.github.com/users/zimingd/repos","events_url":"https://api.github.com/users/zimingd/events{/privacy}","received_events_url":"https://api.github.com/users/zimingd/received_events","type":"User","site_admin":false},"repo":{"id":75245239,"name":"synapsePythonClient","full_name":"zimingd/synapsePythonClient","owner":{"login":"zimingd","id":8023327,"avatar_url":"https://avatars1.githubusercontent.com/u/8023327?v=4","gravatar_id":"","url":"https://api.github.com/users/zimingd","html_url":"https://github.com/zimingd","followers_url":"https://api.github.com/users/zimingd/followers","following_url":"https://api.github.com/users/zimingd/following{/other_user}","gists_url":"https://api.github.com/users/zimingd/gists{/gist_id}","starred_url":"https://api.github.com/users/zimingd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zimingd/subscriptions","organizations_url":"https://api.github.com/users/zimingd/orgs","repos_url":"https://api.github.com/users/zimingd/repos","events_url":"https://api.github.com/users/zimingd/events{/privacy}","received_events_url":"https://api.github.com/users/zimingd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zimingd/synapsePythonClient","description":"Programmatic interface to Synapse services for Python","fork":true,"url":"https://api.github.com/repos/zimingd/synapsePythonClient","forks_url":"https://api.github.com/repos/zimingd/synapsePythonClient/forks","keys_url":"https://api.github.com/repos/zimingd/synapsePythonClient/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zimingd/synapsePythonClient/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zimingd/synapsePythonClient/teams","hooks_url":"https://api.github.com/repos/zimingd/synapsePythonClient/hooks","issue_events_url":"https://api.github.com/repos/zimingd/synapsePythonClient/issues/events{/number}","events_url":"https://api.github.com/repos/zimingd/synapsePythonClient/events","assignees_url":"https://api.github.com/repos/zimingd/synapsePythonClient/assignees{/user}","branches_url":"https://api.github.com/repos/zimingd/synapsePythonClient/branches{/branch}","tags_url":"https://api.github.com/repos/zimingd/synapsePythonClient/tags","blobs_url":"https://api.github.com/repos/zimingd/synapsePythonClient/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zimingd/synapsePythonClient/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zimingd/synapsePythonClient/git/refs{/sha}","trees_url":"https://api.github.com/repos/zimingd/synapsePythonClient/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zimingd/synapsePythonClient/statuses/{sha}","languages_url":"https://api.github.com/repos/zimingd/synapsePythonClient/languages","stargazers_url":"https://api.github.com/repos/zimingd/synapsePythonClient/stargazers","contributors_url":"https://api.github.com/repos/zimingd/synapsePythonClient/contributors","subscribers_url":"https://api.github.com/repos/zimingd/synapsePythonClient/subscribers","subscription_url":"https://api.github.com/repos/zimingd/synapsePythonClient/subscription","commits_url":"https://api.github.com/repos/zimingd/synapsePythonClient/commits{/sha}","git_commits_url":"https://api.github.com/repos/zimingd/synapsePythonClient/git/commits{/sha}","comments_url":"https://api.github.com/repos/zimingd/synapsePythonClient/comments{/number}","issue_comment_url":"https://api.github.com/repos/zimingd/synapsePythonClient/issues/comments{/number}","contents_url":"https://api.github.com/repos/zimingd/synapsePythonClient/contents/{+path}","compare_url":"https://api.github.com/repos/zimingd/synapsePythonClient/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zimingd/synapsePythonClient/merges","archive_url":"https://api.github.com/repos/zimingd/synapsePythonClient/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zimingd/synapsePythonClient/downloads","issues_url":"https://api.github.com/repos/zimingd/synapsePythonClient/issues{/number}","pulls_url":"https://api.github.com/repos/zimingd/synapsePythonClient/pulls{/number}","milestones_url":"https://api.github.com/repos/zimingd/synapsePythonClient/milestones{/number}","notifications_url":"https://api.github.com/repos/zimingd/synapsePythonClient/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zimingd/synapsePythonClient/labels{/name}","releases_url":"https://api.github.com/repos/zimingd/synapsePythonClient/releases{/id}","deployments_url":"https://api.github.com/repos/zimingd/synapsePythonClient/deployments","created_at":"2016-12-01T02:02:11Z","updated_at":"2016-12-01T02:02:12Z","pushed_at":"2017-11-10T22:16:16Z","git_url":"git://github.com/zimingd/synapsePythonClient.git","ssh_url":"git@github.com:zimingd/synapsePythonClient.git","clone_url":"https://github.com/zimingd/synapsePythonClient.git","svn_url":"https://github.com/zimingd/synapsePythonClient","homepage":"https://www.synapse.org","size":4634,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"Sage-Bionetworks:master","ref":"master","sha":"666ac6e77dd146c94176eae716abcf0a13c2ad92","user":{"login":"Sage-Bionetworks","id":1250897,"avatar_url":"https://avatars2.githubusercontent.com/u/1250897?v=4","gravatar_id":"","url":"https://api.github.com/users/Sage-Bionetworks","html_url":"https://github.com/Sage-Bionetworks","followers_url":"https://api.github.com/users/Sage-Bionetworks/followers","following_url":"https://api.github.com/users/Sage-Bionetworks/following{/other_user}","gists_url":"https://api.github.com/users/Sage-Bionetworks/gists{/gist_id}","starred_url":"https://api.github.com/users/Sage-Bionetworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sage-Bionetworks/subscriptions","organizations_url":"https://api.github.com/users/Sage-Bionetworks/orgs","repos_url":"https://api.github.com/users/Sage-Bionetworks/repos","events_url":"https://api.github.com/users/Sage-Bionetworks/events{/privacy}","received_events_url":"https://api.github.com/users/Sage-Bionetworks/received_events","type":"Organization","site_admin":false},"repo":{"id":5497036,"name":"synapsePythonClient","full_name":"Sage-Bionetworks/synapsePythonClient","owner":{"login":"Sage-Bionetworks","id":1250897,"avatar_url":"https://avatars2.githubusercontent.com/u/1250897?v=4","gravatar_id":"","url":"https://api.github.com/users/Sage-Bionetworks","html_url":"https://github.com/Sage-Bionetworks","followers_url":"https://api.github.com/users/Sage-Bionetworks/followers","following_url":"https://api.github.com/users/Sage-Bionetworks/following{/other_user}","gists_url":"https://api.github.com/users/Sage-Bionetworks/gists{/gist_id}","starred_url":"https://api.github.com/users/Sage-Bionetworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sage-Bionetworks/subscriptions","organizations_url":"https://api.github.com/users/Sage-Bionetworks/orgs","repos_url":"https://api.github.com/users/Sage-Bionetworks/repos","events_url":"https://api.github.com/users/Sage-Bionetworks/events{/privacy}","received_events_url":"https://api.github.com/users/Sage-Bionetworks/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Sage-Bionetworks/synapsePythonClient","description":"Programmatic interface to Synapse services for Python","fork":false,"url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient","forks_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/forks","keys_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/teams","hooks_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/hooks","issue_events_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/issues/events{/number}","events_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/events","assignees_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/assignees{/user}","branches_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/branches{/branch}","tags_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/tags","blobs_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/git/refs{/sha}","trees_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/statuses/{sha}","languages_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/languages","stargazers_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/stargazers","contributors_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/contributors","subscribers_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/subscribers","subscription_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/subscription","commits_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/commits{/sha}","git_commits_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/git/commits{/sha}","comments_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/comments{/number}","issue_comment_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/issues/comments{/number}","contents_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/contents/{+path}","compare_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/merges","archive_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/downloads","issues_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/issues{/number}","pulls_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/pulls{/number}","milestones_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/milestones{/number}","notifications_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/labels{/name}","releases_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/releases{/id}","deployments_url":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/deployments","created_at":"2012-08-21T15:32:00Z","updated_at":"2017-10-02T01:37:38Z","pushed_at":"2017-11-10T22:16:18Z","git_url":"git://github.com/Sage-Bionetworks/synapsePythonClient.git","ssh_url":"git@github.com:Sage-Bionetworks/synapsePythonClient.git","clone_url":"https://github.com/Sage-Bionetworks/synapsePythonClient.git","svn_url":"https://github.com/Sage-Bionetworks/synapsePythonClient","homepage":"https://www.synapse.org","size":4524,"stargazers_count":30,"watchers_count":30,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":39,"mirror_url":null,"archived":false,"open_issues_count":10,"forks":39,"open_issues":10,"watchers":30,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/pulls/489"},"html":{"href":"https://github.com/Sage-Bionetworks/synapsePythonClient/pull/489"},"issue":{"href":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/issues/489"},"comments":{"href":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/issues/489/comments"},"review_comments":{"href":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/pulls/489/comments"},"review_comment":{"href":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/pulls/489/commits"},"statuses":{"href":"https://api.github.com/repos/Sage-Bionetworks/synapsePythonClient/statuses/3145b73faa403a7fcef679be8c4f1c14845b0304"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"zimingd"}}