{"action":"created","comment":{"url":"https://api.github.com/repos/eisensheng/pytest-catchlog/pulls/comments/51900787","id":51900787,"diff_hunk":"@@ -71,15 +71,22 @@ def catching_logs(handler, filter=None, formatter=None,\n                 yield handler\n \n \n-def add_option_ini(parser, option, dest, default=None, help=None):\n+def add_option_ini(parser, option, dest, action=None, default=None, help=None):\n     parser.addini(dest, default=default,\n                   help='default value for ' + option)\n-    parser.getgroup('catchlog').addoption(option, dest=dest, help=help)\n+    parser.getgroup('catchlog').addoption(option,\n+                                          action=action,\n+                                          dest=dest,\n+                                          default=default,\n+                                          help=help)\n \n-def get_option_ini(config, name):\n+\n+def get_option_ini(config, name, default=None):\n     ret = config.getoption(name)  # 'default' arg won't work as expected\n     if ret is None:\n         ret = config.getini(name)\n+    if ret == '':\n+        return default","path":"pytest_catchlog.py","position":22,"original_position":22,"commit_id":"92d7332087e818bb3113780fe14e68e2ec5c7f16","original_commit_id":"92d7332087e818bb3113780fe14e68e2ec5c7f16","user":{"login":"s0undt3ch","id":300048,"avatar_url":"https://avatars.githubusercontent.com/u/300048?v=3","gravatar_id":"","url":"https://api.github.com/users/s0undt3ch","html_url":"https://github.com/s0undt3ch","followers_url":"https://api.github.com/users/s0undt3ch/followers","following_url":"https://api.github.com/users/s0undt3ch/following{/other_user}","gists_url":"https://api.github.com/users/s0undt3ch/gists{/gist_id}","starred_url":"https://api.github.com/users/s0undt3ch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s0undt3ch/subscriptions","organizations_url":"https://api.github.com/users/s0undt3ch/orgs","repos_url":"https://api.github.com/users/s0undt3ch/repos","events_url":"https://api.github.com/users/s0undt3ch/events{/privacy}","received_events_url":"https://api.github.com/users/s0undt3ch/received_events","type":"User","site_admin":false},"body":"Options not set in the ini file return an empty string... It's the only way we can trigger returning the default value. And we can't set the default value on the CLI option parser because then the ini option would never be checked against...","created_at":"2016-02-04T16:49:51Z","updated_at":"2016-02-04T16:49:51Z","html_url":"https://github.com/eisensheng/pytest-catchlog/pull/34#discussion_r51900787","pull_request_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/pulls/34","_links":{"self":{"href":"https://api.github.com/repos/eisensheng/pytest-catchlog/pulls/comments/51900787"},"html":{"href":"https://github.com/eisensheng/pytest-catchlog/pull/34#discussion_r51900787"},"pull_request":{"href":"https://api.github.com/repos/eisensheng/pytest-catchlog/pulls/34"}}},"pull_request":{"url":"https://api.github.com/repos/eisensheng/pytest-catchlog/pulls/34","id":58309760,"html_url":"https://github.com/eisensheng/pytest-catchlog/pull/34","diff_url":"https://github.com/eisensheng/pytest-catchlog/pull/34.diff","patch_url":"https://github.com/eisensheng/pytest-catchlog/pull/34.patch","issue_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/issues/34","number":34,"state":"open","locked":false,"title":"Allow configuring `log_print` in the ini file","user":{"login":"s0undt3ch","id":300048,"avatar_url":"https://avatars.githubusercontent.com/u/300048?v=3","gravatar_id":"","url":"https://api.github.com/users/s0undt3ch","html_url":"https://github.com/s0undt3ch","followers_url":"https://api.github.com/users/s0undt3ch/followers","following_url":"https://api.github.com/users/s0undt3ch/following{/other_user}","gists_url":"https://api.github.com/users/s0undt3ch/gists{/gist_id}","starred_url":"https://api.github.com/users/s0undt3ch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s0undt3ch/subscriptions","organizations_url":"https://api.github.com/users/s0undt3ch/orgs","repos_url":"https://api.github.com/users/s0undt3ch/repos","events_url":"https://api.github.com/users/s0undt3ch/events{/privacy}","received_events_url":"https://api.github.com/users/s0undt3ch/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-02-04T16:17:52Z","updated_at":"2016-02-04T16:49:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cd2330cac0ea56caadd6a326d5431bcd7395a91d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/pulls/34/commits","review_comments_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/pulls/34/comments","review_comment_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/pulls/comments{/number}","comments_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/issues/34/comments","statuses_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/statuses/92d7332087e818bb3113780fe14e68e2ec5c7f16","head":{"label":"s0undt3ch:features/ini-no-print-logs","ref":"features/ini-no-print-logs","sha":"92d7332087e818bb3113780fe14e68e2ec5c7f16","user":{"login":"s0undt3ch","id":300048,"avatar_url":"https://avatars.githubusercontent.com/u/300048?v=3","gravatar_id":"","url":"https://api.github.com/users/s0undt3ch","html_url":"https://github.com/s0undt3ch","followers_url":"https://api.github.com/users/s0undt3ch/followers","following_url":"https://api.github.com/users/s0undt3ch/following{/other_user}","gists_url":"https://api.github.com/users/s0undt3ch/gists{/gist_id}","starred_url":"https://api.github.com/users/s0undt3ch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s0undt3ch/subscriptions","organizations_url":"https://api.github.com/users/s0undt3ch/orgs","repos_url":"https://api.github.com/users/s0undt3ch/repos","events_url":"https://api.github.com/users/s0undt3ch/events{/privacy}","received_events_url":"https://api.github.com/users/s0undt3ch/received_events","type":"User","site_admin":false},"repo":{"id":46214853,"name":"pytest-catchlog","full_name":"s0undt3ch/pytest-catchlog","owner":{"login":"s0undt3ch","id":300048,"avatar_url":"https://avatars.githubusercontent.com/u/300048?v=3","gravatar_id":"","url":"https://api.github.com/users/s0undt3ch","html_url":"https://github.com/s0undt3ch","followers_url":"https://api.github.com/users/s0undt3ch/followers","following_url":"https://api.github.com/users/s0undt3ch/following{/other_user}","gists_url":"https://api.github.com/users/s0undt3ch/gists{/gist_id}","starred_url":"https://api.github.com/users/s0undt3ch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s0undt3ch/subscriptions","organizations_url":"https://api.github.com/users/s0undt3ch/orgs","repos_url":"https://api.github.com/users/s0undt3ch/repos","events_url":"https://api.github.com/users/s0undt3ch/events{/privacy}","received_events_url":"https://api.github.com/users/s0undt3ch/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/s0undt3ch/pytest-catchlog","description":"py.test plugin to catch log messages. Forked from pytest-capturelog. Pull Requests are welcome!","fork":true,"url":"https://api.github.com/repos/s0undt3ch/pytest-catchlog","forks_url":"https://api.github.com/repos/s0undt3ch/pytest-catchlog/forks","keys_url":"https://api.github.com/repos/s0undt3ch/pytest-catchlog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/s0undt3ch/pytest-catchlog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/s0undt3ch/pytest-catchlog/teams","hooks_url":"https://api.github.com/repos/s0undt3ch/pytest-catchlog/hooks","issue_events_url":"https://api.github.com/repos/s0undt3ch/pytest-catchlog/issues/events{/number}","events_url":"https://api.github.com/repos/s0undt3ch/pytest-catchlog/events","assignees_url":"https://api.github.com/repos/s0undt3ch/pytest-catchlog/assignees{/user}","branches_url":"https://api.github.com/repos/s0undt3ch/pytest-catchlog/branches{/branch}","tags_url":"https://api.github.com/repos/s0undt3ch/pytest-catchlog/tags","blobs_url":"https://api.github.com/repos/s0undt3ch/pytest-catchlog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/s0undt3ch/pytest-catchlog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/s0undt3ch/pytest-catchlog/git/refs{/sha}","trees_url":"https://api.github.com/repos/s0undt3ch/pytest-catchlog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/s0undt3ch/pytest-catchlog/statuses/{sha}","languages_url":"https://api.github.com/repos/s0undt3ch/pytest-catchlog/languages","stargazers_url":"https://api.github.com/repos/s0undt3ch/pytest-catchlog/stargazers","contributors_url":"https://api.github.com/repos/s0undt3ch/pytest-catchlog/contributors","subscribers_url":"https://api.github.com/repos/s0undt3ch/pytest-catchlog/subscribers","subscription_url":"https://api.github.com/repos/s0undt3ch/pytest-catchlog/subscription","commits_url":"https://api.github.com/repos/s0undt3ch/pytest-catchlog/commits{/sha}","git_commits_url":"https://api.github.com/repos/s0undt3ch/pytest-catchlog/git/commits{/sha}","comments_url":"https://api.github.com/repos/s0undt3ch/pytest-catchlog/comments{/number}","issue_comment_url":"https://api.github.com/repos/s0undt3ch/pytest-catchlog/issues/comments{/number}","contents_url":"https://api.github.com/repos/s0undt3ch/pytest-catchlog/contents/{+path}","compare_url":"https://api.github.com/repos/s0undt3ch/pytest-catchlog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/s0undt3ch/pytest-catchlog/merges","archive_url":"https://api.github.com/repos/s0undt3ch/pytest-catchlog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/s0undt3ch/pytest-catchlog/downloads","issues_url":"https://api.github.com/repos/s0undt3ch/pytest-catchlog/issues{/number}","pulls_url":"https://api.github.com/repos/s0undt3ch/pytest-catchlog/pulls{/number}","milestones_url":"https://api.github.com/repos/s0undt3ch/pytest-catchlog/milestones{/number}","notifications_url":"https://api.github.com/repos/s0undt3ch/pytest-catchlog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/s0undt3ch/pytest-catchlog/labels{/name}","releases_url":"https://api.github.com/repos/s0undt3ch/pytest-catchlog/releases{/id}","deployments_url":"https://api.github.com/repos/s0undt3ch/pytest-catchlog/deployments","created_at":"2015-11-15T11:29:06Z","updated_at":"2016-01-24T12:59:52Z","pushed_at":"2016-02-04T16:27:13Z","git_url":"git://github.com/s0undt3ch/pytest-catchlog.git","ssh_url":"git@github.com:s0undt3ch/pytest-catchlog.git","clone_url":"https://github.com/s0undt3ch/pytest-catchlog.git","svn_url":"https://github.com/s0undt3ch/pytest-catchlog","homepage":"https://pypi.python.org/pypi/pytest-catchlog/","size":75,"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":"develop"}},"base":{"label":"eisensheng:develop","ref":"develop","sha":"d426e0bcc0409a96bc93997dbb9e9e6cc8ece571","user":{"login":"eisensheng","id":72146,"avatar_url":"https://avatars.githubusercontent.com/u/72146?v=3","gravatar_id":"","url":"https://api.github.com/users/eisensheng","html_url":"https://github.com/eisensheng","followers_url":"https://api.github.com/users/eisensheng/followers","following_url":"https://api.github.com/users/eisensheng/following{/other_user}","gists_url":"https://api.github.com/users/eisensheng/gists{/gist_id}","starred_url":"https://api.github.com/users/eisensheng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eisensheng/subscriptions","organizations_url":"https://api.github.com/users/eisensheng/orgs","repos_url":"https://api.github.com/users/eisensheng/repos","events_url":"https://api.github.com/users/eisensheng/events{/privacy}","received_events_url":"https://api.github.com/users/eisensheng/received_events","type":"User","site_admin":false},"repo":{"id":27728976,"name":"pytest-catchlog","full_name":"eisensheng/pytest-catchlog","owner":{"login":"eisensheng","id":72146,"avatar_url":"https://avatars.githubusercontent.com/u/72146?v=3","gravatar_id":"","url":"https://api.github.com/users/eisensheng","html_url":"https://github.com/eisensheng","followers_url":"https://api.github.com/users/eisensheng/followers","following_url":"https://api.github.com/users/eisensheng/following{/other_user}","gists_url":"https://api.github.com/users/eisensheng/gists{/gist_id}","starred_url":"https://api.github.com/users/eisensheng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eisensheng/subscriptions","organizations_url":"https://api.github.com/users/eisensheng/orgs","repos_url":"https://api.github.com/users/eisensheng/repos","events_url":"https://api.github.com/users/eisensheng/events{/privacy}","received_events_url":"https://api.github.com/users/eisensheng/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/eisensheng/pytest-catchlog","description":"py.test plugin to catch log messages. Forked from pytest-capturelog. Pull Requests are welcome!","fork":false,"url":"https://api.github.com/repos/eisensheng/pytest-catchlog","forks_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/forks","keys_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/teams","hooks_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/hooks","issue_events_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/issues/events{/number}","events_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/events","assignees_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/assignees{/user}","branches_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/branches{/branch}","tags_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/tags","blobs_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/git/refs{/sha}","trees_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/statuses/{sha}","languages_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/languages","stargazers_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/stargazers","contributors_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/contributors","subscribers_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/subscribers","subscription_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/subscription","commits_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/commits{/sha}","git_commits_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/git/commits{/sha}","comments_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/comments{/number}","issue_comment_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/issues/comments{/number}","contents_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/contents/{+path}","compare_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/merges","archive_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/downloads","issues_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/issues{/number}","pulls_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/pulls{/number}","milestones_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/milestones{/number}","notifications_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/labels{/name}","releases_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/releases{/id}","deployments_url":"https://api.github.com/repos/eisensheng/pytest-catchlog/deployments","created_at":"2014-12-08T18:36:23Z","updated_at":"2016-01-26T15:04:53Z","pushed_at":"2016-02-04T16:17:52Z","git_url":"git://github.com/eisensheng/pytest-catchlog.git","ssh_url":"git@github.com:eisensheng/pytest-catchlog.git","clone_url":"https://github.com/eisensheng/pytest-catchlog.git","svn_url":"https://github.com/eisensheng/pytest-catchlog","homepage":"https://pypi.python.org/pypi/pytest-catchlog/","size":110,"stargazers_count":13,"watchers_count":13,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":11,"forks":5,"open_issues":11,"watchers":13,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/eisensheng/pytest-catchlog/pulls/34"},"html":{"href":"https://github.com/eisensheng/pytest-catchlog/pull/34"},"issue":{"href":"https://api.github.com/repos/eisensheng/pytest-catchlog/issues/34"},"comments":{"href":"https://api.github.com/repos/eisensheng/pytest-catchlog/issues/34/comments"},"review_comments":{"href":"https://api.github.com/repos/eisensheng/pytest-catchlog/pulls/34/comments"},"review_comment":{"href":"https://api.github.com/repos/eisensheng/pytest-catchlog/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/eisensheng/pytest-catchlog/pulls/34/commits"},"statuses":{"href":"https://api.github.com/repos/eisensheng/pytest-catchlog/statuses/92d7332087e818bb3113780fe14e68e2ec5c7f16"}}}}