{"action":"created","comment":{"url":"https://api.github.com/repos/sphinx-doc/sphinx/pulls/comments/93372200","pull_request_review_id":13897568,"id":93372200,"diff_hunk":"@@ -27,3 +124,78 @@ def is_suppressed_warning(type, subtype, suppress_warnings):\n                 return True\n \n     return False\n+\n+\n+class WarningSuppressor(logging.Filter):\n+    \"\"\"Filter logs by `suppress_warnings`.\"\"\"\n+\n+    def __init__(self, app):\n+        self.app = app\n+        super(WarningSuppressor, self).__init__()\n+\n+    def filter(self, record):\n+        type = getattr(record, 'type', None)\n+        subtype = getattr(record, 'subtype', None)\n+\n+        if is_suppressed_warning(type, subtype, self.app.config.suppress_warnings):\n+            return False\n+        else:\n+            self.app._warncount += 1\n+            return True\n+\n+\n+class WarningIsErrorFilter(logging.Filter):\n+    \"\"\"Raise exception if warning emitted.\"\"\"\n+\n+    def __init__(self, app):\n+        self.app = app\n+        super(WarningIsErrorFilter, self).__init__()\n+\n+    def filter(self, record):\n+        if self.app.warningiserror:\n+            raise SphinxWarning(record.msg % record.args)","path":"sphinx/util/logging.py","position":137,"original_position":137,"commit_id":"03189d71406bcdc8f0fc67c79bdb8bb51f707a31","original_commit_id":"150fb4123bbff4ee9bc575e309e63b581eb3cf05","user":{"login":"shimizukawa","id":151623,"avatar_url":"https://avatars.githubusercontent.com/u/151623?v=3","gravatar_id":"","url":"https://api.github.com/users/shimizukawa","html_url":"https://github.com/shimizukawa","followers_url":"https://api.github.com/users/shimizukawa/followers","following_url":"https://api.github.com/users/shimizukawa/following{/other_user}","gists_url":"https://api.github.com/users/shimizukawa/gists{/gist_id}","starred_url":"https://api.github.com/users/shimizukawa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shimizukawa/subscriptions","organizations_url":"https://api.github.com/users/shimizukawa/orgs","repos_url":"https://api.github.com/users/shimizukawa/repos","events_url":"https://api.github.com/users/shimizukawa/events{/privacy}","received_events_url":"https://api.github.com/users/shimizukawa/received_events","type":"User","site_admin":false},"body":"I see","created_at":"2016-12-21T04:19:33Z","updated_at":"2016-12-21T04:19:33Z","html_url":"https://github.com/sphinx-doc/sphinx/pull/3267#discussion_r93372200","pull_request_url":"https://api.github.com/repos/sphinx-doc/sphinx/pulls/3267","_links":{"self":{"href":"https://api.github.com/repos/sphinx-doc/sphinx/pulls/comments/93372200"},"html":{"href":"https://github.com/sphinx-doc/sphinx/pull/3267#discussion_r93372200"},"pull_request":{"href":"https://api.github.com/repos/sphinx-doc/sphinx/pulls/3267"}}},"pull_request":{"url":"https://api.github.com/repos/sphinx-doc/sphinx/pulls/3267","id":98777900,"html_url":"https://github.com/sphinx-doc/sphinx/pull/3267","diff_url":"https://github.com/sphinx-doc/sphinx/pull/3267.diff","patch_url":"https://github.com/sphinx-doc/sphinx/pull/3267.patch","issue_url":"https://api.github.com/repos/sphinx-doc/sphinx/issues/3267","number":3267,"state":"open","locked":false,"title":"[WIP] Moving to standard logging/warning module","user":{"login":"tk0miya","id":748828,"avatar_url":"https://avatars.githubusercontent.com/u/748828?v=3","gravatar_id":"","url":"https://api.github.com/users/tk0miya","html_url":"https://github.com/tk0miya","followers_url":"https://api.github.com/users/tk0miya/followers","following_url":"https://api.github.com/users/tk0miya/following{/other_user}","gists_url":"https://api.github.com/users/tk0miya/gists{/gist_id}","starred_url":"https://api.github.com/users/tk0miya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tk0miya/subscriptions","organizations_url":"https://api.github.com/users/tk0miya/orgs","repos_url":"https://api.github.com/users/tk0miya/repos","events_url":"https://api.github.com/users/tk0miya/events{/privacy}","received_events_url":"https://api.github.com/users/tk0miya/received_events","type":"User","site_admin":false},"body":"Note: This is still experimental.\r\nrefs: #2367.\r\n\r\nTODO:\r\n\r\n- [ ] Replace `app.info()`\r\n- [ ] Support parallel build\r\n- [ ] Add testcode to verify new logging structure (or test manually?)\r\n- [ ] Replace all `self.warn()` by `logger.warning()`\r\n","created_at":"2016-12-20T16:12:09Z","updated_at":"2016-12-21T04:19:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d265f22d9717222fecd85c8e05fc7b4dda238c42","assignee":{"login":"shimizukawa","id":151623,"avatar_url":"https://avatars.githubusercontent.com/u/151623?v=3","gravatar_id":"","url":"https://api.github.com/users/shimizukawa","html_url":"https://github.com/shimizukawa","followers_url":"https://api.github.com/users/shimizukawa/followers","following_url":"https://api.github.com/users/shimizukawa/following{/other_user}","gists_url":"https://api.github.com/users/shimizukawa/gists{/gist_id}","starred_url":"https://api.github.com/users/shimizukawa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shimizukawa/subscriptions","organizations_url":"https://api.github.com/users/shimizukawa/orgs","repos_url":"https://api.github.com/users/shimizukawa/repos","events_url":"https://api.github.com/users/shimizukawa/events{/privacy}","received_events_url":"https://api.github.com/users/shimizukawa/received_events","type":"User","site_admin":false},"assignees":[{"login":"shimizukawa","id":151623,"avatar_url":"https://avatars.githubusercontent.com/u/151623?v=3","gravatar_id":"","url":"https://api.github.com/users/shimizukawa","html_url":"https://github.com/shimizukawa","followers_url":"https://api.github.com/users/shimizukawa/followers","following_url":"https://api.github.com/users/shimizukawa/following{/other_user}","gists_url":"https://api.github.com/users/shimizukawa/gists{/gist_id}","starred_url":"https://api.github.com/users/shimizukawa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shimizukawa/subscriptions","organizations_url":"https://api.github.com/users/shimizukawa/orgs","repos_url":"https://api.github.com/users/shimizukawa/repos","events_url":"https://api.github.com/users/shimizukawa/events{/privacy}","received_events_url":"https://api.github.com/users/shimizukawa/received_events","type":"User","site_admin":false},{"login":"tk0miya","id":748828,"avatar_url":"https://avatars.githubusercontent.com/u/748828?v=3","gravatar_id":"","url":"https://api.github.com/users/tk0miya","html_url":"https://github.com/tk0miya","followers_url":"https://api.github.com/users/tk0miya/followers","following_url":"https://api.github.com/users/tk0miya/following{/other_user}","gists_url":"https://api.github.com/users/tk0miya/gists{/gist_id}","starred_url":"https://api.github.com/users/tk0miya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tk0miya/subscriptions","organizations_url":"https://api.github.com/users/tk0miya/orgs","repos_url":"https://api.github.com/users/tk0miya/repos","events_url":"https://api.github.com/users/tk0miya/events{/privacy}","received_events_url":"https://api.github.com/users/tk0miya/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/sphinx-doc/sphinx/milestones/23","html_url":"https://github.com/sphinx-doc/sphinx/milestone/23","labels_url":"https://api.github.com/repos/sphinx-doc/sphinx/milestones/23/labels","id":1951439,"number":23,"title":"1.6","description":"Not planned yet.","creator":{"login":"tk0miya","id":748828,"avatar_url":"https://avatars.githubusercontent.com/u/748828?v=3","gravatar_id":"","url":"https://api.github.com/users/tk0miya","html_url":"https://github.com/tk0miya","followers_url":"https://api.github.com/users/tk0miya/followers","following_url":"https://api.github.com/users/tk0miya/following{/other_user}","gists_url":"https://api.github.com/users/tk0miya/gists{/gist_id}","starred_url":"https://api.github.com/users/tk0miya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tk0miya/subscriptions","organizations_url":"https://api.github.com/users/tk0miya/orgs","repos_url":"https://api.github.com/users/tk0miya/repos","events_url":"https://api.github.com/users/tk0miya/events{/privacy}","received_events_url":"https://api.github.com/users/tk0miya/received_events","type":"User","site_admin":false},"open_issues":34,"closed_issues":4,"state":"open","created_at":"2016-08-19T11:50:15Z","updated_at":"2016-12-20T16:12:09Z","due_on":"2017-06-04T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/sphinx-doc/sphinx/pulls/3267/commits","review_comments_url":"https://api.github.com/repos/sphinx-doc/sphinx/pulls/3267/comments","review_comment_url":"https://api.github.com/repos/sphinx-doc/sphinx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sphinx-doc/sphinx/issues/3267/comments","statuses_url":"https://api.github.com/repos/sphinx-doc/sphinx/statuses/03189d71406bcdc8f0fc67c79bdb8bb51f707a31","head":{"label":"tk0miya:2367_logging","ref":"2367_logging","sha":"03189d71406bcdc8f0fc67c79bdb8bb51f707a31","user":{"login":"tk0miya","id":748828,"avatar_url":"https://avatars.githubusercontent.com/u/748828?v=3","gravatar_id":"","url":"https://api.github.com/users/tk0miya","html_url":"https://github.com/tk0miya","followers_url":"https://api.github.com/users/tk0miya/followers","following_url":"https://api.github.com/users/tk0miya/following{/other_user}","gists_url":"https://api.github.com/users/tk0miya/gists{/gist_id}","starred_url":"https://api.github.com/users/tk0miya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tk0miya/subscriptions","organizations_url":"https://api.github.com/users/tk0miya/orgs","repos_url":"https://api.github.com/users/tk0miya/repos","events_url":"https://api.github.com/users/tk0miya/events{/privacy}","received_events_url":"https://api.github.com/users/tk0miya/received_events","type":"User","site_admin":false},"repo":{"id":48524066,"name":"sphinx","full_name":"tk0miya/sphinx","owner":{"login":"tk0miya","id":748828,"avatar_url":"https://avatars.githubusercontent.com/u/748828?v=3","gravatar_id":"","url":"https://api.github.com/users/tk0miya","html_url":"https://github.com/tk0miya","followers_url":"https://api.github.com/users/tk0miya/followers","following_url":"https://api.github.com/users/tk0miya/following{/other_user}","gists_url":"https://api.github.com/users/tk0miya/gists{/gist_id}","starred_url":"https://api.github.com/users/tk0miya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tk0miya/subscriptions","organizations_url":"https://api.github.com/users/tk0miya/orgs","repos_url":"https://api.github.com/users/tk0miya/repos","events_url":"https://api.github.com/users/tk0miya/events{/privacy}","received_events_url":"https://api.github.com/users/tk0miya/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tk0miya/sphinx","description":"Main repository for the Sphinx documentation builder","fork":true,"url":"https://api.github.com/repos/tk0miya/sphinx","forks_url":"https://api.github.com/repos/tk0miya/sphinx/forks","keys_url":"https://api.github.com/repos/tk0miya/sphinx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tk0miya/sphinx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tk0miya/sphinx/teams","hooks_url":"https://api.github.com/repos/tk0miya/sphinx/hooks","issue_events_url":"https://api.github.com/repos/tk0miya/sphinx/issues/events{/number}","events_url":"https://api.github.com/repos/tk0miya/sphinx/events","assignees_url":"https://api.github.com/repos/tk0miya/sphinx/assignees{/user}","branches_url":"https://api.github.com/repos/tk0miya/sphinx/branches{/branch}","tags_url":"https://api.github.com/repos/tk0miya/sphinx/tags","blobs_url":"https://api.github.com/repos/tk0miya/sphinx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tk0miya/sphinx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tk0miya/sphinx/git/refs{/sha}","trees_url":"https://api.github.com/repos/tk0miya/sphinx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tk0miya/sphinx/statuses/{sha}","languages_url":"https://api.github.com/repos/tk0miya/sphinx/languages","stargazers_url":"https://api.github.com/repos/tk0miya/sphinx/stargazers","contributors_url":"https://api.github.com/repos/tk0miya/sphinx/contributors","subscribers_url":"https://api.github.com/repos/tk0miya/sphinx/subscribers","subscription_url":"https://api.github.com/repos/tk0miya/sphinx/subscription","commits_url":"https://api.github.com/repos/tk0miya/sphinx/commits{/sha}","git_commits_url":"https://api.github.com/repos/tk0miya/sphinx/git/commits{/sha}","comments_url":"https://api.github.com/repos/tk0miya/sphinx/comments{/number}","issue_comment_url":"https://api.github.com/repos/tk0miya/sphinx/issues/comments{/number}","contents_url":"https://api.github.com/repos/tk0miya/sphinx/contents/{+path}","compare_url":"https://api.github.com/repos/tk0miya/sphinx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tk0miya/sphinx/merges","archive_url":"https://api.github.com/repos/tk0miya/sphinx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tk0miya/sphinx/downloads","issues_url":"https://api.github.com/repos/tk0miya/sphinx/issues{/number}","pulls_url":"https://api.github.com/repos/tk0miya/sphinx/pulls{/number}","milestones_url":"https://api.github.com/repos/tk0miya/sphinx/milestones{/number}","notifications_url":"https://api.github.com/repos/tk0miya/sphinx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tk0miya/sphinx/labels{/name}","releases_url":"https://api.github.com/repos/tk0miya/sphinx/releases{/id}","deployments_url":"https://api.github.com/repos/tk0miya/sphinx/deployments","created_at":"2015-12-24T04:03:04Z","updated_at":"2016-06-03T13:54:25Z","pushed_at":"2016-12-21T01:53:09Z","git_url":"git://github.com/tk0miya/sphinx.git","ssh_url":"git@github.com:tk0miya/sphinx.git","clone_url":"https://github.com/tk0miya/sphinx.git","svn_url":"https://github.com/tk0miya/sphinx","homepage":"http://sphinx-doc.org","size":19765,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sphinx-doc:master","ref":"master","sha":"673418e7701bc291679de5f41480cff62dec77ce","user":{"login":"sphinx-doc","id":9928167,"avatar_url":"https://avatars.githubusercontent.com/u/9928167?v=3","gravatar_id":"","url":"https://api.github.com/users/sphinx-doc","html_url":"https://github.com/sphinx-doc","followers_url":"https://api.github.com/users/sphinx-doc/followers","following_url":"https://api.github.com/users/sphinx-doc/following{/other_user}","gists_url":"https://api.github.com/users/sphinx-doc/gists{/gist_id}","starred_url":"https://api.github.com/users/sphinx-doc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sphinx-doc/subscriptions","organizations_url":"https://api.github.com/users/sphinx-doc/orgs","repos_url":"https://api.github.com/users/sphinx-doc/repos","events_url":"https://api.github.com/users/sphinx-doc/events{/privacy}","received_events_url":"https://api.github.com/users/sphinx-doc/received_events","type":"Organization","site_admin":false},"repo":{"id":28710753,"name":"sphinx","full_name":"sphinx-doc/sphinx","owner":{"login":"sphinx-doc","id":9928167,"avatar_url":"https://avatars.githubusercontent.com/u/9928167?v=3","gravatar_id":"","url":"https://api.github.com/users/sphinx-doc","html_url":"https://github.com/sphinx-doc","followers_url":"https://api.github.com/users/sphinx-doc/followers","following_url":"https://api.github.com/users/sphinx-doc/following{/other_user}","gists_url":"https://api.github.com/users/sphinx-doc/gists{/gist_id}","starred_url":"https://api.github.com/users/sphinx-doc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sphinx-doc/subscriptions","organizations_url":"https://api.github.com/users/sphinx-doc/orgs","repos_url":"https://api.github.com/users/sphinx-doc/repos","events_url":"https://api.github.com/users/sphinx-doc/events{/privacy}","received_events_url":"https://api.github.com/users/sphinx-doc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sphinx-doc/sphinx","description":"Main repository for the Sphinx documentation builder","fork":false,"url":"https://api.github.com/repos/sphinx-doc/sphinx","forks_url":"https://api.github.com/repos/sphinx-doc/sphinx/forks","keys_url":"https://api.github.com/repos/sphinx-doc/sphinx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sphinx-doc/sphinx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sphinx-doc/sphinx/teams","hooks_url":"https://api.github.com/repos/sphinx-doc/sphinx/hooks","issue_events_url":"https://api.github.com/repos/sphinx-doc/sphinx/issues/events{/number}","events_url":"https://api.github.com/repos/sphinx-doc/sphinx/events","assignees_url":"https://api.github.com/repos/sphinx-doc/sphinx/assignees{/user}","branches_url":"https://api.github.com/repos/sphinx-doc/sphinx/branches{/branch}","tags_url":"https://api.github.com/repos/sphinx-doc/sphinx/tags","blobs_url":"https://api.github.com/repos/sphinx-doc/sphinx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sphinx-doc/sphinx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sphinx-doc/sphinx/git/refs{/sha}","trees_url":"https://api.github.com/repos/sphinx-doc/sphinx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sphinx-doc/sphinx/statuses/{sha}","languages_url":"https://api.github.com/repos/sphinx-doc/sphinx/languages","stargazers_url":"https://api.github.com/repos/sphinx-doc/sphinx/stargazers","contributors_url":"https://api.github.com/repos/sphinx-doc/sphinx/contributors","subscribers_url":"https://api.github.com/repos/sphinx-doc/sphinx/subscribers","subscription_url":"https://api.github.com/repos/sphinx-doc/sphinx/subscription","commits_url":"https://api.github.com/repos/sphinx-doc/sphinx/commits{/sha}","git_commits_url":"https://api.github.com/repos/sphinx-doc/sphinx/git/commits{/sha}","comments_url":"https://api.github.com/repos/sphinx-doc/sphinx/comments{/number}","issue_comment_url":"https://api.github.com/repos/sphinx-doc/sphinx/issues/comments{/number}","contents_url":"https://api.github.com/repos/sphinx-doc/sphinx/contents/{+path}","compare_url":"https://api.github.com/repos/sphinx-doc/sphinx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sphinx-doc/sphinx/merges","archive_url":"https://api.github.com/repos/sphinx-doc/sphinx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sphinx-doc/sphinx/downloads","issues_url":"https://api.github.com/repos/sphinx-doc/sphinx/issues{/number}","pulls_url":"https://api.github.com/repos/sphinx-doc/sphinx/pulls{/number}","milestones_url":"https://api.github.com/repos/sphinx-doc/sphinx/milestones{/number}","notifications_url":"https://api.github.com/repos/sphinx-doc/sphinx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sphinx-doc/sphinx/labels{/name}","releases_url":"https://api.github.com/repos/sphinx-doc/sphinx/releases{/id}","deployments_url":"https://api.github.com/repos/sphinx-doc/sphinx/deployments","created_at":"2015-01-02T10:53:28Z","updated_at":"2016-12-21T02:30:45Z","pushed_at":"2016-12-21T02:56:30Z","git_url":"git://github.com/sphinx-doc/sphinx.git","ssh_url":"git@github.com:sphinx-doc/sphinx.git","clone_url":"https://github.com/sphinx-doc/sphinx.git","svn_url":"https://github.com/sphinx-doc/sphinx","homepage":"http://sphinx-doc.org","size":21347,"stargazers_count":924,"watchers_count":924,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":431,"mirror_url":null,"open_issues_count":592,"forks":431,"open_issues":592,"watchers":924,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sphinx-doc/sphinx/pulls/3267"},"html":{"href":"https://github.com/sphinx-doc/sphinx/pull/3267"},"issue":{"href":"https://api.github.com/repos/sphinx-doc/sphinx/issues/3267"},"comments":{"href":"https://api.github.com/repos/sphinx-doc/sphinx/issues/3267/comments"},"review_comments":{"href":"https://api.github.com/repos/sphinx-doc/sphinx/pulls/3267/comments"},"review_comment":{"href":"https://api.github.com/repos/sphinx-doc/sphinx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sphinx-doc/sphinx/pulls/3267/commits"},"statuses":{"href":"https://api.github.com/repos/sphinx-doc/sphinx/statuses/03189d71406bcdc8f0fc67c79bdb8bb51f707a31"}}}}
{"actor":{"display_login":"shimizukawa"}}