{"action":"created","comment":{"url":"https://api.github.com/repos/fluent/fluent-logger-python/pulls/comments/72183395","id":72183395,"diff_hunk":"@@ -93,16 +93,23 @@ def __init__(self,\n                  host='localhost',\n                  port=24224,\n                  timeout=3.0,\n-                 verbose=False):\n+                 verbose=False,\n+                 parse_json=False):\n \n         self.tag = tag\n         self.sender = sender.FluentSender(tag,\n                                           host=host, port=port,\n                                           timeout=timeout, verbose=verbose)\n+        self.parse_json = parse_json\n         logging.Handler.__init__(self)\n \n     def emit(self, record):\n         data = self.format(record)\n+        if self.parse_json and isinstance(data, basestring):","path":"fluent/handler.py","position":17,"original_position":17,"commit_id":"2c65675d28728cd777045075d89be8004a922105","original_commit_id":"2c65675d28728cd777045075d89be8004a922105","user":{"login":"repeatedly","id":16928,"avatar_url":"https://avatars.githubusercontent.com/u/16928?v=3","gravatar_id":"","url":"https://api.github.com/users/repeatedly","html_url":"https://github.com/repeatedly","followers_url":"https://api.github.com/users/repeatedly/followers","following_url":"https://api.github.com/users/repeatedly/following{/other_user}","gists_url":"https://api.github.com/users/repeatedly/gists{/gist_id}","starred_url":"https://api.github.com/users/repeatedly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/repeatedly/subscriptions","organizations_url":"https://api.github.com/users/repeatedly/orgs","repos_url":"https://api.github.com/users/repeatedly/repos","events_url":"https://api.github.com/users/repeatedly/events{/privacy}","received_events_url":"https://api.github.com/users/repeatedly/received_events","type":"User","site_admin":false},"body":"`basestring` is available in Python 3?","created_at":"2016-07-26T03:35:43Z","updated_at":"2016-07-26T03:35:43Z","html_url":"https://github.com/fluent/fluent-logger-python/pull/42#discussion_r72183395","pull_request_url":"https://api.github.com/repos/fluent/fluent-logger-python/pulls/42","_links":{"self":{"href":"https://api.github.com/repos/fluent/fluent-logger-python/pulls/comments/72183395"},"html":{"href":"https://github.com/fluent/fluent-logger-python/pull/42#discussion_r72183395"},"pull_request":{"href":"https://api.github.com/repos/fluent/fluent-logger-python/pulls/42"}}},"pull_request":{"url":"https://api.github.com/repos/fluent/fluent-logger-python/pulls/42","id":46370643,"html_url":"https://github.com/fluent/fluent-logger-python/pull/42","diff_url":"https://github.com/fluent/fluent-logger-python/pull/42.diff","patch_url":"https://github.com/fluent/fluent-logger-python/pull/42.patch","issue_url":"https://api.github.com/repos/fluent/fluent-logger-python/issues/42","number":42,"state":"open","locked":false,"title":"Parse JSON after format","user":{"login":"mmasaki","id":315008,"avatar_url":"https://avatars.githubusercontent.com/u/315008?v=3","gravatar_id":"","url":"https://api.github.com/users/mmasaki","html_url":"https://github.com/mmasaki","followers_url":"https://api.github.com/users/mmasaki/followers","following_url":"https://api.github.com/users/mmasaki/following{/other_user}","gists_url":"https://api.github.com/users/mmasaki/gists{/gist_id}","starred_url":"https://api.github.com/users/mmasaki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmasaki/subscriptions","organizations_url":"https://api.github.com/users/mmasaki/orgs","repos_url":"https://api.github.com/users/mmasaki/repos","events_url":"https://api.github.com/users/mmasaki/events{/privacy}","received_events_url":"https://api.github.com/users/mmasaki/received_events","type":"User","site_admin":false},"body":"This change add feature to parse JSON after format.\r\nIt would be helpful to use FluentHandler with formatters\r\nother than FluentRecordFormatter.\r\n\r\nIn my case, I want to use FluentHnadler with oslo_log.formatters.JSONFormatter.\r\n\r\nhttps://github.com/openstack/oslo.log/blob/master/oslo_log/formatters.py#L64","created_at":"2015-09-30T07:49:06Z","updated_at":"2016-07-26T03:35:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c7dceb4ed47e09f36f8ee3ab0bb7086dfecde155","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/fluent/fluent-logger-python/pulls/42/commits","review_comments_url":"https://api.github.com/repos/fluent/fluent-logger-python/pulls/42/comments","review_comment_url":"https://api.github.com/repos/fluent/fluent-logger-python/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fluent/fluent-logger-python/issues/42/comments","statuses_url":"https://api.github.com/repos/fluent/fluent-logger-python/statuses/2c65675d28728cd777045075d89be8004a922105","head":{"label":"mmasaki:parse_json","ref":"parse_json","sha":"2c65675d28728cd777045075d89be8004a922105","user":{"login":"mmasaki","id":315008,"avatar_url":"https://avatars.githubusercontent.com/u/315008?v=3","gravatar_id":"","url":"https://api.github.com/users/mmasaki","html_url":"https://github.com/mmasaki","followers_url":"https://api.github.com/users/mmasaki/followers","following_url":"https://api.github.com/users/mmasaki/following{/other_user}","gists_url":"https://api.github.com/users/mmasaki/gists{/gist_id}","starred_url":"https://api.github.com/users/mmasaki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmasaki/subscriptions","organizations_url":"https://api.github.com/users/mmasaki/orgs","repos_url":"https://api.github.com/users/mmasaki/repos","events_url":"https://api.github.com/users/mmasaki/events{/privacy}","received_events_url":"https://api.github.com/users/mmasaki/received_events","type":"User","site_admin":false},"repo":{"id":43276284,"name":"fluent-logger-python","full_name":"mmasaki/fluent-logger-python","owner":{"login":"mmasaki","id":315008,"avatar_url":"https://avatars.githubusercontent.com/u/315008?v=3","gravatar_id":"","url":"https://api.github.com/users/mmasaki","html_url":"https://github.com/mmasaki","followers_url":"https://api.github.com/users/mmasaki/followers","following_url":"https://api.github.com/users/mmasaki/following{/other_user}","gists_url":"https://api.github.com/users/mmasaki/gists{/gist_id}","starred_url":"https://api.github.com/users/mmasaki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmasaki/subscriptions","organizations_url":"https://api.github.com/users/mmasaki/orgs","repos_url":"https://api.github.com/users/mmasaki/repos","events_url":"https://api.github.com/users/mmasaki/events{/privacy}","received_events_url":"https://api.github.com/users/mmasaki/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mmasaki/fluent-logger-python","description":"A structured logger for Fluentd (Python)","fork":true,"url":"https://api.github.com/repos/mmasaki/fluent-logger-python","forks_url":"https://api.github.com/repos/mmasaki/fluent-logger-python/forks","keys_url":"https://api.github.com/repos/mmasaki/fluent-logger-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mmasaki/fluent-logger-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mmasaki/fluent-logger-python/teams","hooks_url":"https://api.github.com/repos/mmasaki/fluent-logger-python/hooks","issue_events_url":"https://api.github.com/repos/mmasaki/fluent-logger-python/issues/events{/number}","events_url":"https://api.github.com/repos/mmasaki/fluent-logger-python/events","assignees_url":"https://api.github.com/repos/mmasaki/fluent-logger-python/assignees{/user}","branches_url":"https://api.github.com/repos/mmasaki/fluent-logger-python/branches{/branch}","tags_url":"https://api.github.com/repos/mmasaki/fluent-logger-python/tags","blobs_url":"https://api.github.com/repos/mmasaki/fluent-logger-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mmasaki/fluent-logger-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mmasaki/fluent-logger-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/mmasaki/fluent-logger-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mmasaki/fluent-logger-python/statuses/{sha}","languages_url":"https://api.github.com/repos/mmasaki/fluent-logger-python/languages","stargazers_url":"https://api.github.com/repos/mmasaki/fluent-logger-python/stargazers","contributors_url":"https://api.github.com/repos/mmasaki/fluent-logger-python/contributors","subscribers_url":"https://api.github.com/repos/mmasaki/fluent-logger-python/subscribers","subscription_url":"https://api.github.com/repos/mmasaki/fluent-logger-python/subscription","commits_url":"https://api.github.com/repos/mmasaki/fluent-logger-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/mmasaki/fluent-logger-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/mmasaki/fluent-logger-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/mmasaki/fluent-logger-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/mmasaki/fluent-logger-python/contents/{+path}","compare_url":"https://api.github.com/repos/mmasaki/fluent-logger-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mmasaki/fluent-logger-python/merges","archive_url":"https://api.github.com/repos/mmasaki/fluent-logger-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mmasaki/fluent-logger-python/downloads","issues_url":"https://api.github.com/repos/mmasaki/fluent-logger-python/issues{/number}","pulls_url":"https://api.github.com/repos/mmasaki/fluent-logger-python/pulls{/number}","milestones_url":"https://api.github.com/repos/mmasaki/fluent-logger-python/milestones{/number}","notifications_url":"https://api.github.com/repos/mmasaki/fluent-logger-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mmasaki/fluent-logger-python/labels{/name}","releases_url":"https://api.github.com/repos/mmasaki/fluent-logger-python/releases{/id}","deployments_url":"https://api.github.com/repos/mmasaki/fluent-logger-python/deployments","created_at":"2015-09-28T02:45:45Z","updated_at":"2015-09-28T02:45:46Z","pushed_at":"2015-10-01T10:03:27Z","git_url":"git://github.com/mmasaki/fluent-logger-python.git","ssh_url":"git@github.com:mmasaki/fluent-logger-python.git","clone_url":"https://github.com/mmasaki/fluent-logger-python.git","svn_url":"https://github.com/mmasaki/fluent-logger-python","homepage":"http://fluentd.org/","size":145,"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":"fluent:master","ref":"master","sha":"875bc72fa50edf943d18bd82b9ffe5489135b342","user":{"login":"fluent","id":859518,"avatar_url":"https://avatars.githubusercontent.com/u/859518?v=3","gravatar_id":"","url":"https://api.github.com/users/fluent","html_url":"https://github.com/fluent","followers_url":"https://api.github.com/users/fluent/followers","following_url":"https://api.github.com/users/fluent/following{/other_user}","gists_url":"https://api.github.com/users/fluent/gists{/gist_id}","starred_url":"https://api.github.com/users/fluent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fluent/subscriptions","organizations_url":"https://api.github.com/users/fluent/orgs","repos_url":"https://api.github.com/users/fluent/repos","events_url":"https://api.github.com/users/fluent/events{/privacy}","received_events_url":"https://api.github.com/users/fluent/received_events","type":"Organization","site_admin":false},"repo":{"id":2494665,"name":"fluent-logger-python","full_name":"fluent/fluent-logger-python","owner":{"login":"fluent","id":859518,"avatar_url":"https://avatars.githubusercontent.com/u/859518?v=3","gravatar_id":"","url":"https://api.github.com/users/fluent","html_url":"https://github.com/fluent","followers_url":"https://api.github.com/users/fluent/followers","following_url":"https://api.github.com/users/fluent/following{/other_user}","gists_url":"https://api.github.com/users/fluent/gists{/gist_id}","starred_url":"https://api.github.com/users/fluent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fluent/subscriptions","organizations_url":"https://api.github.com/users/fluent/orgs","repos_url":"https://api.github.com/users/fluent/repos","events_url":"https://api.github.com/users/fluent/events{/privacy}","received_events_url":"https://api.github.com/users/fluent/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fluent/fluent-logger-python","description":"A structured logger for Fluentd (Python)","fork":false,"url":"https://api.github.com/repos/fluent/fluent-logger-python","forks_url":"https://api.github.com/repos/fluent/fluent-logger-python/forks","keys_url":"https://api.github.com/repos/fluent/fluent-logger-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fluent/fluent-logger-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fluent/fluent-logger-python/teams","hooks_url":"https://api.github.com/repos/fluent/fluent-logger-python/hooks","issue_events_url":"https://api.github.com/repos/fluent/fluent-logger-python/issues/events{/number}","events_url":"https://api.github.com/repos/fluent/fluent-logger-python/events","assignees_url":"https://api.github.com/repos/fluent/fluent-logger-python/assignees{/user}","branches_url":"https://api.github.com/repos/fluent/fluent-logger-python/branches{/branch}","tags_url":"https://api.github.com/repos/fluent/fluent-logger-python/tags","blobs_url":"https://api.github.com/repos/fluent/fluent-logger-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fluent/fluent-logger-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fluent/fluent-logger-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/fluent/fluent-logger-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fluent/fluent-logger-python/statuses/{sha}","languages_url":"https://api.github.com/repos/fluent/fluent-logger-python/languages","stargazers_url":"https://api.github.com/repos/fluent/fluent-logger-python/stargazers","contributors_url":"https://api.github.com/repos/fluent/fluent-logger-python/contributors","subscribers_url":"https://api.github.com/repos/fluent/fluent-logger-python/subscribers","subscription_url":"https://api.github.com/repos/fluent/fluent-logger-python/subscription","commits_url":"https://api.github.com/repos/fluent/fluent-logger-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/fluent/fluent-logger-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/fluent/fluent-logger-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/fluent/fluent-logger-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/fluent/fluent-logger-python/contents/{+path}","compare_url":"https://api.github.com/repos/fluent/fluent-logger-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fluent/fluent-logger-python/merges","archive_url":"https://api.github.com/repos/fluent/fluent-logger-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fluent/fluent-logger-python/downloads","issues_url":"https://api.github.com/repos/fluent/fluent-logger-python/issues{/number}","pulls_url":"https://api.github.com/repos/fluent/fluent-logger-python/pulls{/number}","milestones_url":"https://api.github.com/repos/fluent/fluent-logger-python/milestones{/number}","notifications_url":"https://api.github.com/repos/fluent/fluent-logger-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fluent/fluent-logger-python/labels{/name}","releases_url":"https://api.github.com/repos/fluent/fluent-logger-python/releases{/id}","deployments_url":"https://api.github.com/repos/fluent/fluent-logger-python/deployments","created_at":"2011-10-01T12:09:45Z","updated_at":"2016-07-21T13:05:47Z","pushed_at":"2016-07-26T01:58:51Z","git_url":"git://github.com/fluent/fluent-logger-python.git","ssh_url":"git@github.com:fluent/fluent-logger-python.git","clone_url":"https://github.com/fluent/fluent-logger-python.git","svn_url":"https://github.com/fluent/fluent-logger-python","homepage":"http://fluentd.org/","size":141,"stargazers_count":145,"watchers_count":145,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":65,"mirror_url":null,"open_issues_count":9,"forks":65,"open_issues":9,"watchers":145,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fluent/fluent-logger-python/pulls/42"},"html":{"href":"https://github.com/fluent/fluent-logger-python/pull/42"},"issue":{"href":"https://api.github.com/repos/fluent/fluent-logger-python/issues/42"},"comments":{"href":"https://api.github.com/repos/fluent/fluent-logger-python/issues/42/comments"},"review_comments":{"href":"https://api.github.com/repos/fluent/fluent-logger-python/pulls/42/comments"},"review_comment":{"href":"https://api.github.com/repos/fluent/fluent-logger-python/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fluent/fluent-logger-python/pulls/42/commits"},"statuses":{"href":"https://api.github.com/repos/fluent/fluent-logger-python/statuses/2c65675d28728cd777045075d89be8004a922105"}}}}
{"actor":{"display_login":"repeatedly"}}