{"action":"created","comment":{"url":"https://api.github.com/repos/hynek/structlog/pulls/comments/22996324","id":22996324,"diff_hunk":"@@ -149,6 +198,31 @@ def __call__(self, *args):\n         return logging.getLogger(name)\n \n \n+class StdlibFormatEventRenderer(object):\n+    \"\"\"\n+    Applies stdlib-like string formatting to the `event` key with the arguments\n+    in the `positional_args` key. This is populated by\n+    `structlog.stdlib.BoundLogger` or can be manually set.\n+\n+    `positional_args` can be any iterable, but a dictionary as the single\n+    element of the tuple is used instead of the tuple, to mantain compatibility\n+    with the undocumented feature of stdlib logging.\n+\n+    \"\"\"\n+    def __init__(self, strip_positional_args=False):\n+        self.strip_positional_args = strip_positional_args\n+\n+    def __call__(self, _, __, event_dict):\n+        args = event_dict.get('positional_args')\n+        if args:\n+            args = tuple(args)\n+            if len(args) == 1 and isinstance(args[0], dict) and args[0]:","path":"structlog/stdlib.py","position":126,"original_position":126,"commit_id":"0cea46b72831a0072f050511c5e077a40c5af56d","original_commit_id":"0cea46b72831a0072f050511c5e077a40c5af56d","user":{"login":"wbolster","id":748944,"avatar_url":"https://avatars.githubusercontent.com/u/748944?v=3","gravatar_id":"","url":"https://api.github.com/users/wbolster","html_url":"https://github.com/wbolster","followers_url":"https://api.github.com/users/wbolster/followers","following_url":"https://api.github.com/users/wbolster/following{/other_user}","gists_url":"https://api.github.com/users/wbolster/gists{/gist_id}","starred_url":"https://api.github.com/users/wbolster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wbolster/subscriptions","organizations_url":"https://api.github.com/users/wbolster/orgs","repos_url":"https://api.github.com/users/wbolster/repos","events_url":"https://api.github.com/users/wbolster/events{/privacy}","received_events_url":"https://api.github.com/users/wbolster/received_events","type":"User","site_admin":false},"body":"yes.\n\nHynek Schlawack <notifications@github.com> schreef op 15 januari 2015 09:02:29 CET:\n>> +    in the `positional_args` key. This is populated by\n>> +    `structlog.stdlib.BoundLogger` or can be manually set.\n>> +\n>> +    `positional_args` can be any iterable, but a dictionary as the\n>single\n>> +    element of the tuple is used instead of the tuple, to mantain\n>compatibility\n>> +    with the undocumented feature of stdlib logging.\n>> +\n>> +    \"\"\"\n>> +    def __init__(self, strip_positional_args=False):\n>> +        self.strip_positional_args = strip_positional_args\n>> +\n>> +    def __call__(self, _, __, event_dict):\n>> +        args = event_dict.get('positional_args')\n>> +        if args:\n>> +            args = tuple(args)\n>> +            if len(args) == 1 and isinstance(args[0], dict) and\n>args[0]:\n>\n>So IOW, this fragment was only there because the tests called the\n>method wrong?  I figured something like that.\n>\n>---\n>Reply to this email directly or view it on GitHub:\n>https://github.com/hynek/structlog/pull/29/files#r22994968\n\n-- \nSent from my Android device with K-9 Mail. Please excuse my brevity.","created_at":"2015-01-15T08:42:57Z","updated_at":"2015-01-15T08:42:57Z","html_url":"https://github.com/hynek/structlog/pull/29#discussion_r22996324","pull_request_url":"https://api.github.com/repos/hynek/structlog/pulls/29","_links":{"self":{"href":"https://api.github.com/repos/hynek/structlog/pulls/comments/22996324"},"html":{"href":"https://github.com/hynek/structlog/pull/29#discussion_r22996324"},"pull_request":{"href":"https://api.github.com/repos/hynek/structlog/pulls/29"}}},"pull_request":{"url":"https://api.github.com/repos/hynek/structlog/pulls/29","id":24014709,"html_url":"https://github.com/hynek/structlog/pull/29","diff_url":"https://github.com/hynek/structlog/pull/29.diff","patch_url":"https://github.com/hynek/structlog/pull/29.patch","issue_url":"https://api.github.com/repos/hynek/structlog/issues/29","number":29,"state":"open","locked":false,"title":"Issue 19 fix: Pass #2: Pass positional arguments down to stdlib","user":{"login":"lakshmi-kannan","id":1839421,"avatar_url":"https://avatars.githubusercontent.com/u/1839421?v=3","gravatar_id":"","url":"https://api.github.com/users/lakshmi-kannan","html_url":"https://github.com/lakshmi-kannan","followers_url":"https://api.github.com/users/lakshmi-kannan/followers","following_url":"https://api.github.com/users/lakshmi-kannan/following{/other_user}","gists_url":"https://api.github.com/users/lakshmi-kannan/gists{/gist_id}","starred_url":"https://api.github.com/users/lakshmi-kannan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lakshmi-kannan/subscriptions","organizations_url":"https://api.github.com/users/lakshmi-kannan/orgs","repos_url":"https://api.github.com/users/lakshmi-kannan/repos","events_url":"https://api.github.com/users/lakshmi-kannan/events{/privacy}","received_events_url":"https://api.github.com/users/lakshmi-kannan/received_events","type":"User","site_admin":false},"body":"Ref: https://github.com/hynek/structlog/pull/23\r\n\r\nApologies for opening another PR for same issue. I didn't want to pollute the original author's PR. \r\n\r\nI addressed all of your comments that I agreed with and added a commit. I retained the original author's commit as well. Tox tests pass on my box. \r\n\r\nI disagreed with one comment about adding pass through methods in stdlib BoundLogger (https://github.com/hynek/structlog/pull/23/files#diff-519ce9a9803f8404219d01de0afb0c1fR65). There are more than 5 such methods that are in stdlib logger. I was reading the code for the first time and instantly got what getattr was trying to do. I don't feel like it's magic. If you still insist on explicit pass through methods, I can add a commit. Please let me know. ","created_at":"2014-11-06T21:36:46Z","updated_at":"2015-01-15T08:42:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3b5cf6d3adb4569ac92c8a94ab1acfd36fa2d849","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hynek/structlog/pulls/29/commits","review_comments_url":"https://api.github.com/repos/hynek/structlog/pulls/29/comments","review_comment_url":"https://api.github.com/repos/hynek/structlog/pulls/comments/{number}","comments_url":"https://api.github.com/repos/hynek/structlog/issues/29/comments","statuses_url":"https://api.github.com/repos/hynek/structlog/statuses/0cea46b72831a0072f050511c5e077a40c5af56d","head":{"label":"lakshmi-kannan:issue-19-fix","ref":"issue-19-fix","sha":"0cea46b72831a0072f050511c5e077a40c5af56d","user":{"login":"lakshmi-kannan","id":1839421,"avatar_url":"https://avatars.githubusercontent.com/u/1839421?v=3","gravatar_id":"","url":"https://api.github.com/users/lakshmi-kannan","html_url":"https://github.com/lakshmi-kannan","followers_url":"https://api.github.com/users/lakshmi-kannan/followers","following_url":"https://api.github.com/users/lakshmi-kannan/following{/other_user}","gists_url":"https://api.github.com/users/lakshmi-kannan/gists{/gist_id}","starred_url":"https://api.github.com/users/lakshmi-kannan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lakshmi-kannan/subscriptions","organizations_url":"https://api.github.com/users/lakshmi-kannan/orgs","repos_url":"https://api.github.com/users/lakshmi-kannan/repos","events_url":"https://api.github.com/users/lakshmi-kannan/events{/privacy}","received_events_url":"https://api.github.com/users/lakshmi-kannan/received_events","type":"User","site_admin":false},"repo":{"id":22267555,"name":"structlog","full_name":"lakshmi-kannan/structlog","owner":{"login":"lakshmi-kannan","id":1839421,"avatar_url":"https://avatars.githubusercontent.com/u/1839421?v=3","gravatar_id":"","url":"https://api.github.com/users/lakshmi-kannan","html_url":"https://github.com/lakshmi-kannan","followers_url":"https://api.github.com/users/lakshmi-kannan/followers","following_url":"https://api.github.com/users/lakshmi-kannan/following{/other_user}","gists_url":"https://api.github.com/users/lakshmi-kannan/gists{/gist_id}","starred_url":"https://api.github.com/users/lakshmi-kannan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lakshmi-kannan/subscriptions","organizations_url":"https://api.github.com/users/lakshmi-kannan/orgs","repos_url":"https://api.github.com/users/lakshmi-kannan/repos","events_url":"https://api.github.com/users/lakshmi-kannan/events{/privacy}","received_events_url":"https://api.github.com/users/lakshmi-kannan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lakshmi-kannan/structlog","description":"Structured Logging for Python","fork":true,"url":"https://api.github.com/repos/lakshmi-kannan/structlog","forks_url":"https://api.github.com/repos/lakshmi-kannan/structlog/forks","keys_url":"https://api.github.com/repos/lakshmi-kannan/structlog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lakshmi-kannan/structlog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lakshmi-kannan/structlog/teams","hooks_url":"https://api.github.com/repos/lakshmi-kannan/structlog/hooks","issue_events_url":"https://api.github.com/repos/lakshmi-kannan/structlog/issues/events{/number}","events_url":"https://api.github.com/repos/lakshmi-kannan/structlog/events","assignees_url":"https://api.github.com/repos/lakshmi-kannan/structlog/assignees{/user}","branches_url":"https://api.github.com/repos/lakshmi-kannan/structlog/branches{/branch}","tags_url":"https://api.github.com/repos/lakshmi-kannan/structlog/tags","blobs_url":"https://api.github.com/repos/lakshmi-kannan/structlog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lakshmi-kannan/structlog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lakshmi-kannan/structlog/git/refs{/sha}","trees_url":"https://api.github.com/repos/lakshmi-kannan/structlog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lakshmi-kannan/structlog/statuses/{sha}","languages_url":"https://api.github.com/repos/lakshmi-kannan/structlog/languages","stargazers_url":"https://api.github.com/repos/lakshmi-kannan/structlog/stargazers","contributors_url":"https://api.github.com/repos/lakshmi-kannan/structlog/contributors","subscribers_url":"https://api.github.com/repos/lakshmi-kannan/structlog/subscribers","subscription_url":"https://api.github.com/repos/lakshmi-kannan/structlog/subscription","commits_url":"https://api.github.com/repos/lakshmi-kannan/structlog/commits{/sha}","git_commits_url":"https://api.github.com/repos/lakshmi-kannan/structlog/git/commits{/sha}","comments_url":"https://api.github.com/repos/lakshmi-kannan/structlog/comments{/number}","issue_comment_url":"https://api.github.com/repos/lakshmi-kannan/structlog/issues/comments/{number}","contents_url":"https://api.github.com/repos/lakshmi-kannan/structlog/contents/{+path}","compare_url":"https://api.github.com/repos/lakshmi-kannan/structlog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lakshmi-kannan/structlog/merges","archive_url":"https://api.github.com/repos/lakshmi-kannan/structlog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lakshmi-kannan/structlog/downloads","issues_url":"https://api.github.com/repos/lakshmi-kannan/structlog/issues{/number}","pulls_url":"https://api.github.com/repos/lakshmi-kannan/structlog/pulls{/number}","milestones_url":"https://api.github.com/repos/lakshmi-kannan/structlog/milestones{/number}","notifications_url":"https://api.github.com/repos/lakshmi-kannan/structlog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lakshmi-kannan/structlog/labels{/name}","releases_url":"https://api.github.com/repos/lakshmi-kannan/structlog/releases{/id}","created_at":"2014-07-25T19:02:49Z","updated_at":"2014-07-15T11:32:54Z","pushed_at":"2014-11-12T01:21:46Z","git_url":"git://github.com/lakshmi-kannan/structlog.git","ssh_url":"git@github.com:lakshmi-kannan/structlog.git","clone_url":"https://github.com/lakshmi-kannan/structlog.git","svn_url":"https://github.com/lakshmi-kannan/structlog","homepage":"http://www.structlog.org/","size":678,"stargazers_count":0,"watchers_count":0,"language":null,"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":"hynek:master","ref":"master","sha":"ba460ca8669f0506e30377abf8ae14012cb90fc6","user":{"login":"hynek","id":41240,"avatar_url":"https://avatars.githubusercontent.com/u/41240?v=3","gravatar_id":"","url":"https://api.github.com/users/hynek","html_url":"https://github.com/hynek","followers_url":"https://api.github.com/users/hynek/followers","following_url":"https://api.github.com/users/hynek/following{/other_user}","gists_url":"https://api.github.com/users/hynek/gists{/gist_id}","starred_url":"https://api.github.com/users/hynek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hynek/subscriptions","organizations_url":"https://api.github.com/users/hynek/orgs","repos_url":"https://api.github.com/users/hynek/repos","events_url":"https://api.github.com/users/hynek/events{/privacy}","received_events_url":"https://api.github.com/users/hynek/received_events","type":"User","site_admin":false},"repo":{"id":12085960,"name":"structlog","full_name":"hynek/structlog","owner":{"login":"hynek","id":41240,"avatar_url":"https://avatars.githubusercontent.com/u/41240?v=3","gravatar_id":"","url":"https://api.github.com/users/hynek","html_url":"https://github.com/hynek","followers_url":"https://api.github.com/users/hynek/followers","following_url":"https://api.github.com/users/hynek/following{/other_user}","gists_url":"https://api.github.com/users/hynek/gists{/gist_id}","starred_url":"https://api.github.com/users/hynek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hynek/subscriptions","organizations_url":"https://api.github.com/users/hynek/orgs","repos_url":"https://api.github.com/users/hynek/repos","events_url":"https://api.github.com/users/hynek/events{/privacy}","received_events_url":"https://api.github.com/users/hynek/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hynek/structlog","description":"Structured Logging for Python","fork":false,"url":"https://api.github.com/repos/hynek/structlog","forks_url":"https://api.github.com/repos/hynek/structlog/forks","keys_url":"https://api.github.com/repos/hynek/structlog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hynek/structlog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hynek/structlog/teams","hooks_url":"https://api.github.com/repos/hynek/structlog/hooks","issue_events_url":"https://api.github.com/repos/hynek/structlog/issues/events{/number}","events_url":"https://api.github.com/repos/hynek/structlog/events","assignees_url":"https://api.github.com/repos/hynek/structlog/assignees{/user}","branches_url":"https://api.github.com/repos/hynek/structlog/branches{/branch}","tags_url":"https://api.github.com/repos/hynek/structlog/tags","blobs_url":"https://api.github.com/repos/hynek/structlog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hynek/structlog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hynek/structlog/git/refs{/sha}","trees_url":"https://api.github.com/repos/hynek/structlog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hynek/structlog/statuses/{sha}","languages_url":"https://api.github.com/repos/hynek/structlog/languages","stargazers_url":"https://api.github.com/repos/hynek/structlog/stargazers","contributors_url":"https://api.github.com/repos/hynek/structlog/contributors","subscribers_url":"https://api.github.com/repos/hynek/structlog/subscribers","subscription_url":"https://api.github.com/repos/hynek/structlog/subscription","commits_url":"https://api.github.com/repos/hynek/structlog/commits{/sha}","git_commits_url":"https://api.github.com/repos/hynek/structlog/git/commits{/sha}","comments_url":"https://api.github.com/repos/hynek/structlog/comments{/number}","issue_comment_url":"https://api.github.com/repos/hynek/structlog/issues/comments/{number}","contents_url":"https://api.github.com/repos/hynek/structlog/contents/{+path}","compare_url":"https://api.github.com/repos/hynek/structlog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hynek/structlog/merges","archive_url":"https://api.github.com/repos/hynek/structlog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hynek/structlog/downloads","issues_url":"https://api.github.com/repos/hynek/structlog/issues{/number}","pulls_url":"https://api.github.com/repos/hynek/structlog/pulls{/number}","milestones_url":"https://api.github.com/repos/hynek/structlog/milestones{/number}","notifications_url":"https://api.github.com/repos/hynek/structlog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hynek/structlog/labels{/name}","releases_url":"https://api.github.com/repos/hynek/structlog/releases{/id}","created_at":"2013-08-13T15:55:58Z","updated_at":"2015-01-15T08:35:12Z","pushed_at":"2015-01-15T08:35:11Z","git_url":"git://github.com/hynek/structlog.git","ssh_url":"git@github.com:hynek/structlog.git","clone_url":"https://github.com/hynek/structlog.git","svn_url":"https://github.com/hynek/structlog","homepage":"http://www.structlog.org/","size":2416,"stargazers_count":213,"watchers_count":213,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":15,"forks":14,"open_issues":15,"watchers":213,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hynek/structlog/pulls/29"},"html":{"href":"https://github.com/hynek/structlog/pull/29"},"issue":{"href":"https://api.github.com/repos/hynek/structlog/issues/29"},"comments":{"href":"https://api.github.com/repos/hynek/structlog/issues/29/comments"},"review_comments":{"href":"https://api.github.com/repos/hynek/structlog/pulls/29/comments"},"review_comment":{"href":"https://api.github.com/repos/hynek/structlog/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/hynek/structlog/pulls/29/commits"},"statuses":{"href":"https://api.github.com/repos/hynek/structlog/statuses/0cea46b72831a0072f050511c5e077a40c5af56d"}}}}