{"action":"created","comment":{"url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/pulls/comments/212423601","pull_request_review_id":149054277,"id":212423601,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMjQyMzYwMQ==","diff_hunk":"@@ -249,7 +250,9 @@ func (dht *IpfsDHT) handlePing(_ context.Context, p peer.ID, pmes *pb.Message) (\n }\n \n func (dht *IpfsDHT) handleFindPeer(ctx context.Context, p peer.ID, pmes *pb.Message) (*pb.Message, error) {\n-\tdefer log.EventBegin(ctx, \"handleFindPeer\", p).Done()\n+\tctx = log.Start(ctx, \"handleFindPeer\")\n+\tdefer log.Finish(ctx)","path":"handlers.go","position":48,"original_position":48,"commit_id":"174c565eac6076b265c0cf8ca2e0a321027190c0","original_commit_id":"174c565eac6076b265c0cf8ca2e0a321027190c0","user":{"login":"Stebalien","id":310393,"node_id":"MDQ6VXNlcjMxMDM5Mw==","avatar_url":"https://avatars2.githubusercontent.com/u/310393?v=4","gravatar_id":"","url":"https://api.github.com/users/Stebalien","html_url":"https://github.com/Stebalien","followers_url":"https://api.github.com/users/Stebalien/followers","following_url":"https://api.github.com/users/Stebalien/following{/other_user}","gists_url":"https://api.github.com/users/Stebalien/gists{/gist_id}","starred_url":"https://api.github.com/users/Stebalien/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Stebalien/subscriptions","organizations_url":"https://api.github.com/users/Stebalien/orgs","repos_url":"https://api.github.com/users/Stebalien/repos","events_url":"https://api.github.com/users/Stebalien/events{/privacy}","received_events_url":"https://api.github.com/users/Stebalien/received_events","type":"User","site_admin":false},"body":"You can actually skip the `SetErr` now and:\r\n\r\n1. Set a named error return value (e.g., `_err`). This'll \"capture\" the err return value in a variable and make it accessible from deferred functions.\r\n2. Use `defer func() { log.FinishWithErr(ctx, _err) }`\r\n\r\nBut that's up to you.","created_at":"2018-08-23T19:06:11Z","updated_at":"2018-08-23T19:07:19Z","html_url":"https://github.com/libp2p/go-libp2p-kad-dht/pull/190#discussion_r212423601","pull_request_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/pulls/190","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/pulls/comments/212423601"},"html":{"href":"https://github.com/libp2p/go-libp2p-kad-dht/pull/190#discussion_r212423601"},"pull_request":{"href":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/pulls/190"}}},"pull_request":{"url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/pulls/190","id":210349042,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEwMzQ5MDQy","html_url":"https://github.com/libp2p/go-libp2p-kad-dht/pull/190","diff_url":"https://github.com/libp2p/go-libp2p-kad-dht/pull/190.diff","patch_url":"https://github.com/libp2p/go-libp2p-kad-dht/pull/190.patch","issue_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/issues/190","number":190,"state":"open","locked":false,"title":"Some key-value is missing in the log","user":{"login":"cshuaimin","id":24775746,"node_id":"MDQ6VXNlcjI0Nzc1NzQ2","avatar_url":"https://avatars1.githubusercontent.com/u/24775746?v=4","gravatar_id":"","url":"https://api.github.com/users/cshuaimin","html_url":"https://github.com/cshuaimin","followers_url":"https://api.github.com/users/cshuaimin/followers","following_url":"https://api.github.com/users/cshuaimin/following{/other_user}","gists_url":"https://api.github.com/users/cshuaimin/gists{/gist_id}","starred_url":"https://api.github.com/users/cshuaimin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cshuaimin/subscriptions","organizations_url":"https://api.github.com/users/cshuaimin/orgs","repos_url":"https://api.github.com/users/cshuaimin/repos","events_url":"https://api.github.com/users/cshuaimin/events{/privacy}","received_events_url":"https://api.github.com/users/cshuaimin/received_events","type":"User","site_admin":false},"body":"handlers.go line 301:\r\n```go\r\nlm := make(lgbl.DeferredMap)\r\nlm[\"peer\"] = func() interface{} { return p.Pretty() }\r\neip := log.EventBegin(ctx, \"handleGetProviders\", lm)\r\ndefer eip.Done()\r\n// ...\r\nlm[\"key\"] = func() interface{} { return c.String() }\r\n```\r\nThe last line does not work and the `key` does not appear in the log message. And I see that the `EventBegin` has been deprecated, so I changed all `EventBegin` to `Start`.","created_at":"2018-08-23T07:00:50Z","updated_at":"2018-08-23T19:07:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"624bedafb3d05905507dac2276beb79a8432b1fa","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/pulls/190/commits","review_comments_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/pulls/190/comments","review_comment_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/pulls/comments{/number}","comments_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/issues/190/comments","statuses_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/statuses/174c565eac6076b265c0cf8ca2e0a321027190c0","head":{"label":"cshuaimin:master","ref":"master","sha":"174c565eac6076b265c0cf8ca2e0a321027190c0","user":{"login":"cshuaimin","id":24775746,"node_id":"MDQ6VXNlcjI0Nzc1NzQ2","avatar_url":"https://avatars1.githubusercontent.com/u/24775746?v=4","gravatar_id":"","url":"https://api.github.com/users/cshuaimin","html_url":"https://github.com/cshuaimin","followers_url":"https://api.github.com/users/cshuaimin/followers","following_url":"https://api.github.com/users/cshuaimin/following{/other_user}","gists_url":"https://api.github.com/users/cshuaimin/gists{/gist_id}","starred_url":"https://api.github.com/users/cshuaimin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cshuaimin/subscriptions","organizations_url":"https://api.github.com/users/cshuaimin/orgs","repos_url":"https://api.github.com/users/cshuaimin/repos","events_url":"https://api.github.com/users/cshuaimin/events{/privacy}","received_events_url":"https://api.github.com/users/cshuaimin/received_events","type":"User","site_admin":false},"repo":{"id":145812543,"node_id":"MDEwOlJlcG9zaXRvcnkxNDU4MTI1NDM=","name":"go-libp2p-kad-dht","full_name":"cshuaimin/go-libp2p-kad-dht","owner":{"login":"cshuaimin","id":24775746,"node_id":"MDQ6VXNlcjI0Nzc1NzQ2","avatar_url":"https://avatars1.githubusercontent.com/u/24775746?v=4","gravatar_id":"","url":"https://api.github.com/users/cshuaimin","html_url":"https://github.com/cshuaimin","followers_url":"https://api.github.com/users/cshuaimin/followers","following_url":"https://api.github.com/users/cshuaimin/following{/other_user}","gists_url":"https://api.github.com/users/cshuaimin/gists{/gist_id}","starred_url":"https://api.github.com/users/cshuaimin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cshuaimin/subscriptions","organizations_url":"https://api.github.com/users/cshuaimin/orgs","repos_url":"https://api.github.com/users/cshuaimin/repos","events_url":"https://api.github.com/users/cshuaimin/events{/privacy}","received_events_url":"https://api.github.com/users/cshuaimin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cshuaimin/go-libp2p-kad-dht","description":"A Kademlia DHT implemention on go-libp2p","fork":true,"url":"https://api.github.com/repos/cshuaimin/go-libp2p-kad-dht","forks_url":"https://api.github.com/repos/cshuaimin/go-libp2p-kad-dht/forks","keys_url":"https://api.github.com/repos/cshuaimin/go-libp2p-kad-dht/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cshuaimin/go-libp2p-kad-dht/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cshuaimin/go-libp2p-kad-dht/teams","hooks_url":"https://api.github.com/repos/cshuaimin/go-libp2p-kad-dht/hooks","issue_events_url":"https://api.github.com/repos/cshuaimin/go-libp2p-kad-dht/issues/events{/number}","events_url":"https://api.github.com/repos/cshuaimin/go-libp2p-kad-dht/events","assignees_url":"https://api.github.com/repos/cshuaimin/go-libp2p-kad-dht/assignees{/user}","branches_url":"https://api.github.com/repos/cshuaimin/go-libp2p-kad-dht/branches{/branch}","tags_url":"https://api.github.com/repos/cshuaimin/go-libp2p-kad-dht/tags","blobs_url":"https://api.github.com/repos/cshuaimin/go-libp2p-kad-dht/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cshuaimin/go-libp2p-kad-dht/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cshuaimin/go-libp2p-kad-dht/git/refs{/sha}","trees_url":"https://api.github.com/repos/cshuaimin/go-libp2p-kad-dht/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cshuaimin/go-libp2p-kad-dht/statuses/{sha}","languages_url":"https://api.github.com/repos/cshuaimin/go-libp2p-kad-dht/languages","stargazers_url":"https://api.github.com/repos/cshuaimin/go-libp2p-kad-dht/stargazers","contributors_url":"https://api.github.com/repos/cshuaimin/go-libp2p-kad-dht/contributors","subscribers_url":"https://api.github.com/repos/cshuaimin/go-libp2p-kad-dht/subscribers","subscription_url":"https://api.github.com/repos/cshuaimin/go-libp2p-kad-dht/subscription","commits_url":"https://api.github.com/repos/cshuaimin/go-libp2p-kad-dht/commits{/sha}","git_commits_url":"https://api.github.com/repos/cshuaimin/go-libp2p-kad-dht/git/commits{/sha}","comments_url":"https://api.github.com/repos/cshuaimin/go-libp2p-kad-dht/comments{/number}","issue_comment_url":"https://api.github.com/repos/cshuaimin/go-libp2p-kad-dht/issues/comments{/number}","contents_url":"https://api.github.com/repos/cshuaimin/go-libp2p-kad-dht/contents/{+path}","compare_url":"https://api.github.com/repos/cshuaimin/go-libp2p-kad-dht/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cshuaimin/go-libp2p-kad-dht/merges","archive_url":"https://api.github.com/repos/cshuaimin/go-libp2p-kad-dht/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cshuaimin/go-libp2p-kad-dht/downloads","issues_url":"https://api.github.com/repos/cshuaimin/go-libp2p-kad-dht/issues{/number}","pulls_url":"https://api.github.com/repos/cshuaimin/go-libp2p-kad-dht/pulls{/number}","milestones_url":"https://api.github.com/repos/cshuaimin/go-libp2p-kad-dht/milestones{/number}","notifications_url":"https://api.github.com/repos/cshuaimin/go-libp2p-kad-dht/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cshuaimin/go-libp2p-kad-dht/labels{/name}","releases_url":"https://api.github.com/repos/cshuaimin/go-libp2p-kad-dht/releases{/id}","deployments_url":"https://api.github.com/repos/cshuaimin/go-libp2p-kad-dht/deployments","created_at":"2018-08-23T06:45:22Z","updated_at":"2018-08-23T07:12:45Z","pushed_at":"2018-08-23T07:12:43Z","git_url":"git://github.com/cshuaimin/go-libp2p-kad-dht.git","ssh_url":"git@github.com:cshuaimin/go-libp2p-kad-dht.git","clone_url":"https://github.com/cshuaimin/go-libp2p-kad-dht.git","svn_url":"https://github.com/cshuaimin/go-libp2p-kad-dht","homepage":"","size":1085,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"libp2p:master","ref":"master","sha":"db60bb1814f49f18385a58f5e668f0412d3cb9ff","user":{"login":"libp2p","id":14838238,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0ODM4MjM4","avatar_url":"https://avatars3.githubusercontent.com/u/14838238?v=4","gravatar_id":"","url":"https://api.github.com/users/libp2p","html_url":"https://github.com/libp2p","followers_url":"https://api.github.com/users/libp2p/followers","following_url":"https://api.github.com/users/libp2p/following{/other_user}","gists_url":"https://api.github.com/users/libp2p/gists{/gist_id}","starred_url":"https://api.github.com/users/libp2p/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libp2p/subscriptions","organizations_url":"https://api.github.com/users/libp2p/orgs","repos_url":"https://api.github.com/users/libp2p/repos","events_url":"https://api.github.com/users/libp2p/events{/privacy}","received_events_url":"https://api.github.com/users/libp2p/received_events","type":"Organization","site_admin":false},"repo":{"id":66214665,"node_id":"MDEwOlJlcG9zaXRvcnk2NjIxNDY2NQ==","name":"go-libp2p-kad-dht","full_name":"libp2p/go-libp2p-kad-dht","owner":{"login":"libp2p","id":14838238,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0ODM4MjM4","avatar_url":"https://avatars3.githubusercontent.com/u/14838238?v=4","gravatar_id":"","url":"https://api.github.com/users/libp2p","html_url":"https://github.com/libp2p","followers_url":"https://api.github.com/users/libp2p/followers","following_url":"https://api.github.com/users/libp2p/following{/other_user}","gists_url":"https://api.github.com/users/libp2p/gists{/gist_id}","starred_url":"https://api.github.com/users/libp2p/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libp2p/subscriptions","organizations_url":"https://api.github.com/users/libp2p/orgs","repos_url":"https://api.github.com/users/libp2p/repos","events_url":"https://api.github.com/users/libp2p/events{/privacy}","received_events_url":"https://api.github.com/users/libp2p/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/libp2p/go-libp2p-kad-dht","description":"A Kademlia DHT implemention on go-libp2p","fork":false,"url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht","forks_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/forks","keys_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/keys{/key_id}","collaborators_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/teams","hooks_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/hooks","issue_events_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/issues/events{/number}","events_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/events","assignees_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/assignees{/user}","branches_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/branches{/branch}","tags_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/tags","blobs_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/git/refs{/sha}","trees_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/git/trees{/sha}","statuses_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/statuses/{sha}","languages_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/languages","stargazers_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/stargazers","contributors_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/contributors","subscribers_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/subscribers","subscription_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/subscription","commits_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/commits{/sha}","git_commits_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/git/commits{/sha}","comments_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/comments{/number}","issue_comment_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/issues/comments{/number}","contents_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/contents/{+path}","compare_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/compare/{base}...{head}","merges_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/merges","archive_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/downloads","issues_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/issues{/number}","pulls_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/pulls{/number}","milestones_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/milestones{/number}","notifications_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/labels{/name}","releases_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/releases{/id}","deployments_url":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/deployments","created_at":"2016-08-21T18:40:35Z","updated_at":"2018-08-22T00:25:56Z","pushed_at":"2018-08-23T07:12:44Z","git_url":"git://github.com/libp2p/go-libp2p-kad-dht.git","ssh_url":"git@github.com:libp2p/go-libp2p-kad-dht.git","clone_url":"https://github.com/libp2p/go-libp2p-kad-dht.git","svn_url":"https://github.com/libp2p/go-libp2p-kad-dht","homepage":"","size":1079,"stargazers_count":116,"watchers_count":116,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":46,"mirror_url":null,"archived":false,"open_issues_count":31,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":46,"open_issues":31,"watchers":116,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/pulls/190"},"html":{"href":"https://github.com/libp2p/go-libp2p-kad-dht/pull/190"},"issue":{"href":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/issues/190"},"comments":{"href":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/issues/190/comments"},"review_comments":{"href":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/pulls/190/comments"},"review_comment":{"href":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/pulls/190/commits"},"statuses":{"href":"https://api.github.com/repos/libp2p/go-libp2p-kad-dht/statuses/174c565eac6076b265c0cf8ca2e0a321027190c0"}},"author_association":"NONE"}}
{"actor":{"display_login":"Stebalien"}}