{"action":"created","comment":{"url":"https://api.github.com/repos/ipfs/go-log/pulls/comments/182817932","pull_request_review_id":113694738,"id":182817932,"diff_hunk":"@@ -0,0 +1,78 @@\n+package loggabletracer\n+\n+import (\n+\t\"bytes\"\n+\t\"fmt\"\n+\t\"runtime\"\n+\t\"strconv\"\n+\t\"sync\"\n+)\n+\n+const debugGoroutineIDTag = \"_initial_goroutine\"\n+\n+type errAssertionFailed struct {\n+\tspan *spanImpl\n+\tmsg  string\n+}\n+\n+// Error implements the error interface.\n+func (err *errAssertionFailed) Error() string {\n+\treturn fmt.Sprintf(\"%s:\\n%+v\", err.msg, err.span)\n+}\n+\n+func (s *spanImpl) Lock() {\n+\ts.Mutex.Lock()\n+\ts.maybeAssertSanityLocked()\n+}\n+\n+func (s *spanImpl) maybeAssertSanityLocked() {\n+\tif s.tracer == nil {\n+\t\ts.Mutex.Unlock()\n+\t\tpanic(&errAssertionFailed{span: s, msg: \"span used after call to Finish()\"})\n+\t}\n+\tif s.tracer.options.DebugAssertSingleGoroutine {\n+\t\tstartID := curGoroutineID()\n+\t\tcurID, ok := s.raw.Tags[debugGoroutineIDTag].(uint64)\n+\t\tif !ok {\n+\t\t\t// This is likely invoked in the context of the SetTag which sets\n+\t\t\t// debugGoroutineTag.\n+\t\t\treturn\n+\t\t}\n+\t\tif startID != curID {\n+\t\t\ts.Mutex.Unlock()\n+\t\t\tpanic(&errAssertionFailed{\n+\t\t\t\tspan: s,\n+\t\t\t\tmsg:  fmt.Sprintf(\"span started on goroutine %d, but now running on %d\", startID, curID),\n+\t\t\t})\n+\t\t}\n+\t}\n+}\n+\n+var goroutineSpace = []byte(\"goroutine \")\n+var littleBuf = sync.Pool{\n+\tNew: func() interface{} {\n+\t\tbuf := make([]byte, 64)\n+\t\treturn &buf\n+\t},\n+}\n+\n+// Credit to @bradfitz:\n+// https://github.com/golang/net/blob/master/http2/gotrack.go#L51\n+func curGoroutineID() uint64 {","path":"tracer/debug.go","position":61,"original_position":61,"commit_id":"c9f4609ce9906f1dcc06ebb8510b4c0ffa2acde5","original_commit_id":"c9f4609ce9906f1dcc06ebb8510b4c0ffa2acde5","user":{"login":"whyrusleeping","id":1243164,"avatar_url":"https://avatars0.githubusercontent.com/u/1243164?v=4","gravatar_id":"","url":"https://api.github.com/users/whyrusleeping","html_url":"https://github.com/whyrusleeping","followers_url":"https://api.github.com/users/whyrusleeping/followers","following_url":"https://api.github.com/users/whyrusleeping/following{/other_user}","gists_url":"https://api.github.com/users/whyrusleeping/gists{/gist_id}","starred_url":"https://api.github.com/users/whyrusleeping/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whyrusleeping/subscriptions","organizations_url":"https://api.github.com/users/whyrusleeping/orgs","repos_url":"https://api.github.com/users/whyrusleeping/repos","events_url":"https://api.github.com/users/whyrusleeping/events{/privacy}","received_events_url":"https://api.github.com/users/whyrusleeping/received_events","type":"User","site_admin":false},"body":"what the christ","created_at":"2018-04-19T17:03:00Z","updated_at":"2018-04-19T17:03:00Z","html_url":"https://github.com/ipfs/go-log/pull/20#discussion_r182817932","pull_request_url":"https://api.github.com/repos/ipfs/go-log/pulls/20","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/ipfs/go-log/pulls/comments/182817932"},"html":{"href":"https://github.com/ipfs/go-log/pull/20#discussion_r182817932"},"pull_request":{"href":"https://api.github.com/repos/ipfs/go-log/pulls/20"}}},"pull_request":{"url":"https://api.github.com/repos/ipfs/go-log/pulls/20","id":173248638,"html_url":"https://github.com/ipfs/go-log/pull/20","diff_url":"https://github.com/ipfs/go-log/pull/20.diff","patch_url":"https://github.com/ipfs/go-log/pull/20.patch","issue_url":"https://api.github.com/repos/ipfs/go-log/issues/20","number":20,"state":"open","locked":false,"title":"Add loggabletracer and record using the MirrorWriter ","user":{"login":"frrist","id":6546409,"avatar_url":"https://avatars1.githubusercontent.com/u/6546409?v=4","gravatar_id":"","url":"https://api.github.com/users/frrist","html_url":"https://github.com/frrist","followers_url":"https://api.github.com/users/frrist/followers","following_url":"https://api.github.com/users/frrist/following{/other_user}","gists_url":"https://api.github.com/users/frrist/gists{/gist_id}","starred_url":"https://api.github.com/users/frrist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frrist/subscriptions","organizations_url":"https://api.github.com/users/frrist/orgs","repos_url":"https://api.github.com/users/frrist/repos","events_url":"https://api.github.com/users/frrist/events{/privacy}","received_events_url":"https://api.github.com/users/frrist/received_events","type":"User","site_admin":false},"body":"TODO\r\n- [ ] import file history from opentracing/basictracer and add licence","created_at":"2018-03-06T18:51:52Z","updated_at":"2018-04-19T17:03:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f74756289161753b650ad7cca553d96bc80a6e00","assignee":{"login":"frrist","id":6546409,"avatar_url":"https://avatars1.githubusercontent.com/u/6546409?v=4","gravatar_id":"","url":"https://api.github.com/users/frrist","html_url":"https://github.com/frrist","followers_url":"https://api.github.com/users/frrist/followers","following_url":"https://api.github.com/users/frrist/following{/other_user}","gists_url":"https://api.github.com/users/frrist/gists{/gist_id}","starred_url":"https://api.github.com/users/frrist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frrist/subscriptions","organizations_url":"https://api.github.com/users/frrist/orgs","repos_url":"https://api.github.com/users/frrist/repos","events_url":"https://api.github.com/users/frrist/events{/privacy}","received_events_url":"https://api.github.com/users/frrist/received_events","type":"User","site_admin":false},"assignees":[{"login":"frrist","id":6546409,"avatar_url":"https://avatars1.githubusercontent.com/u/6546409?v=4","gravatar_id":"","url":"https://api.github.com/users/frrist","html_url":"https://github.com/frrist","followers_url":"https://api.github.com/users/frrist/followers","following_url":"https://api.github.com/users/frrist/following{/other_user}","gists_url":"https://api.github.com/users/frrist/gists{/gist_id}","starred_url":"https://api.github.com/users/frrist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frrist/subscriptions","organizations_url":"https://api.github.com/users/frrist/orgs","repos_url":"https://api.github.com/users/frrist/repos","events_url":"https://api.github.com/users/frrist/events{/privacy}","received_events_url":"https://api.github.com/users/frrist/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":260412010,"url":"https://api.github.com/repos/ipfs/go-log/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":562208267,"url":"https://api.github.com/repos/ipfs/go-log/labels/in%20progress","name":"in progress","color":"ededed","default":false},{"id":314373968,"url":"https://api.github.com/repos/ipfs/go-log/labels/needs%20review","name":"needs review","color":"0052cc","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ipfs/go-log/pulls/20/commits","review_comments_url":"https://api.github.com/repos/ipfs/go-log/pulls/20/comments","review_comment_url":"https://api.github.com/repos/ipfs/go-log/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ipfs/go-log/issues/20/comments","statuses_url":"https://api.github.com/repos/ipfs/go-log/statuses/c9f4609ce9906f1dcc06ebb8510b4c0ffa2acde5","head":{"label":"ipfs:feat/newEventType","ref":"feat/newEventType","sha":"c9f4609ce9906f1dcc06ebb8510b4c0ffa2acde5","user":{"login":"ipfs","id":10536621,"avatar_url":"https://avatars0.githubusercontent.com/u/10536621?v=4","gravatar_id":"","url":"https://api.github.com/users/ipfs","html_url":"https://github.com/ipfs","followers_url":"https://api.github.com/users/ipfs/followers","following_url":"https://api.github.com/users/ipfs/following{/other_user}","gists_url":"https://api.github.com/users/ipfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ipfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipfs/subscriptions","organizations_url":"https://api.github.com/users/ipfs/orgs","repos_url":"https://api.github.com/users/ipfs/repos","events_url":"https://api.github.com/users/ipfs/events{/privacy}","received_events_url":"https://api.github.com/users/ipfs/received_events","type":"Organization","site_admin":false},"repo":{"id":42484122,"name":"go-log","full_name":"ipfs/go-log","owner":{"login":"ipfs","id":10536621,"avatar_url":"https://avatars0.githubusercontent.com/u/10536621?v=4","gravatar_id":"","url":"https://api.github.com/users/ipfs","html_url":"https://github.com/ipfs","followers_url":"https://api.github.com/users/ipfs/followers","following_url":"https://api.github.com/users/ipfs/following{/other_user}","gists_url":"https://api.github.com/users/ipfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ipfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipfs/subscriptions","organizations_url":"https://api.github.com/users/ipfs/orgs","repos_url":"https://api.github.com/users/ipfs/repos","events_url":"https://api.github.com/users/ipfs/events{/privacy}","received_events_url":"https://api.github.com/users/ipfs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ipfs/go-log","description":"A logging library used by go-ipfs","fork":false,"url":"https://api.github.com/repos/ipfs/go-log","forks_url":"https://api.github.com/repos/ipfs/go-log/forks","keys_url":"https://api.github.com/repos/ipfs/go-log/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ipfs/go-log/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ipfs/go-log/teams","hooks_url":"https://api.github.com/repos/ipfs/go-log/hooks","issue_events_url":"https://api.github.com/repos/ipfs/go-log/issues/events{/number}","events_url":"https://api.github.com/repos/ipfs/go-log/events","assignees_url":"https://api.github.com/repos/ipfs/go-log/assignees{/user}","branches_url":"https://api.github.com/repos/ipfs/go-log/branches{/branch}","tags_url":"https://api.github.com/repos/ipfs/go-log/tags","blobs_url":"https://api.github.com/repos/ipfs/go-log/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ipfs/go-log/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ipfs/go-log/git/refs{/sha}","trees_url":"https://api.github.com/repos/ipfs/go-log/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ipfs/go-log/statuses/{sha}","languages_url":"https://api.github.com/repos/ipfs/go-log/languages","stargazers_url":"https://api.github.com/repos/ipfs/go-log/stargazers","contributors_url":"https://api.github.com/repos/ipfs/go-log/contributors","subscribers_url":"https://api.github.com/repos/ipfs/go-log/subscribers","subscription_url":"https://api.github.com/repos/ipfs/go-log/subscription","commits_url":"https://api.github.com/repos/ipfs/go-log/commits{/sha}","git_commits_url":"https://api.github.com/repos/ipfs/go-log/git/commits{/sha}","comments_url":"https://api.github.com/repos/ipfs/go-log/comments{/number}","issue_comment_url":"https://api.github.com/repos/ipfs/go-log/issues/comments{/number}","contents_url":"https://api.github.com/repos/ipfs/go-log/contents/{+path}","compare_url":"https://api.github.com/repos/ipfs/go-log/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ipfs/go-log/merges","archive_url":"https://api.github.com/repos/ipfs/go-log/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ipfs/go-log/downloads","issues_url":"https://api.github.com/repos/ipfs/go-log/issues{/number}","pulls_url":"https://api.github.com/repos/ipfs/go-log/pulls{/number}","milestones_url":"https://api.github.com/repos/ipfs/go-log/milestones{/number}","notifications_url":"https://api.github.com/repos/ipfs/go-log/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ipfs/go-log/labels{/name}","releases_url":"https://api.github.com/repos/ipfs/go-log/releases{/id}","deployments_url":"https://api.github.com/repos/ipfs/go-log/deployments","created_at":"2015-09-15T00:04:46Z","updated_at":"2018-04-16T04:00:03Z","pushed_at":"2018-04-17T19:49:34Z","git_url":"git://github.com/ipfs/go-log.git","ssh_url":"git@github.com:ipfs/go-log.git","clone_url":"https://github.com/ipfs/go-log.git","svn_url":"https://github.com/ipfs/go-log","homepage":null,"size":93,"stargazers_count":6,"watchers_count":6,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":9,"open_issues":4,"watchers":6,"default_branch":"master"}},"base":{"label":"ipfs:master","ref":"master","sha":"4b54e7d2460df21c1c2d345af2337f91bfc938ca","user":{"login":"ipfs","id":10536621,"avatar_url":"https://avatars0.githubusercontent.com/u/10536621?v=4","gravatar_id":"","url":"https://api.github.com/users/ipfs","html_url":"https://github.com/ipfs","followers_url":"https://api.github.com/users/ipfs/followers","following_url":"https://api.github.com/users/ipfs/following{/other_user}","gists_url":"https://api.github.com/users/ipfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ipfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipfs/subscriptions","organizations_url":"https://api.github.com/users/ipfs/orgs","repos_url":"https://api.github.com/users/ipfs/repos","events_url":"https://api.github.com/users/ipfs/events{/privacy}","received_events_url":"https://api.github.com/users/ipfs/received_events","type":"Organization","site_admin":false},"repo":{"id":42484122,"name":"go-log","full_name":"ipfs/go-log","owner":{"login":"ipfs","id":10536621,"avatar_url":"https://avatars0.githubusercontent.com/u/10536621?v=4","gravatar_id":"","url":"https://api.github.com/users/ipfs","html_url":"https://github.com/ipfs","followers_url":"https://api.github.com/users/ipfs/followers","following_url":"https://api.github.com/users/ipfs/following{/other_user}","gists_url":"https://api.github.com/users/ipfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ipfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipfs/subscriptions","organizations_url":"https://api.github.com/users/ipfs/orgs","repos_url":"https://api.github.com/users/ipfs/repos","events_url":"https://api.github.com/users/ipfs/events{/privacy}","received_events_url":"https://api.github.com/users/ipfs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ipfs/go-log","description":"A logging library used by go-ipfs","fork":false,"url":"https://api.github.com/repos/ipfs/go-log","forks_url":"https://api.github.com/repos/ipfs/go-log/forks","keys_url":"https://api.github.com/repos/ipfs/go-log/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ipfs/go-log/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ipfs/go-log/teams","hooks_url":"https://api.github.com/repos/ipfs/go-log/hooks","issue_events_url":"https://api.github.com/repos/ipfs/go-log/issues/events{/number}","events_url":"https://api.github.com/repos/ipfs/go-log/events","assignees_url":"https://api.github.com/repos/ipfs/go-log/assignees{/user}","branches_url":"https://api.github.com/repos/ipfs/go-log/branches{/branch}","tags_url":"https://api.github.com/repos/ipfs/go-log/tags","blobs_url":"https://api.github.com/repos/ipfs/go-log/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ipfs/go-log/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ipfs/go-log/git/refs{/sha}","trees_url":"https://api.github.com/repos/ipfs/go-log/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ipfs/go-log/statuses/{sha}","languages_url":"https://api.github.com/repos/ipfs/go-log/languages","stargazers_url":"https://api.github.com/repos/ipfs/go-log/stargazers","contributors_url":"https://api.github.com/repos/ipfs/go-log/contributors","subscribers_url":"https://api.github.com/repos/ipfs/go-log/subscribers","subscription_url":"https://api.github.com/repos/ipfs/go-log/subscription","commits_url":"https://api.github.com/repos/ipfs/go-log/commits{/sha}","git_commits_url":"https://api.github.com/repos/ipfs/go-log/git/commits{/sha}","comments_url":"https://api.github.com/repos/ipfs/go-log/comments{/number}","issue_comment_url":"https://api.github.com/repos/ipfs/go-log/issues/comments{/number}","contents_url":"https://api.github.com/repos/ipfs/go-log/contents/{+path}","compare_url":"https://api.github.com/repos/ipfs/go-log/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ipfs/go-log/merges","archive_url":"https://api.github.com/repos/ipfs/go-log/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ipfs/go-log/downloads","issues_url":"https://api.github.com/repos/ipfs/go-log/issues{/number}","pulls_url":"https://api.github.com/repos/ipfs/go-log/pulls{/number}","milestones_url":"https://api.github.com/repos/ipfs/go-log/milestones{/number}","notifications_url":"https://api.github.com/repos/ipfs/go-log/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ipfs/go-log/labels{/name}","releases_url":"https://api.github.com/repos/ipfs/go-log/releases{/id}","deployments_url":"https://api.github.com/repos/ipfs/go-log/deployments","created_at":"2015-09-15T00:04:46Z","updated_at":"2018-04-16T04:00:03Z","pushed_at":"2018-04-17T19:49:34Z","git_url":"git://github.com/ipfs/go-log.git","ssh_url":"git@github.com:ipfs/go-log.git","clone_url":"https://github.com/ipfs/go-log.git","svn_url":"https://github.com/ipfs/go-log","homepage":null,"size":93,"stargazers_count":6,"watchers_count":6,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":9,"open_issues":4,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ipfs/go-log/pulls/20"},"html":{"href":"https://github.com/ipfs/go-log/pull/20"},"issue":{"href":"https://api.github.com/repos/ipfs/go-log/issues/20"},"comments":{"href":"https://api.github.com/repos/ipfs/go-log/issues/20/comments"},"review_comments":{"href":"https://api.github.com/repos/ipfs/go-log/pulls/20/comments"},"review_comment":{"href":"https://api.github.com/repos/ipfs/go-log/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ipfs/go-log/pulls/20/commits"},"statuses":{"href":"https://api.github.com/repos/ipfs/go-log/statuses/c9f4609ce9906f1dcc06ebb8510b4c0ffa2acde5"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"whyrusleeping"}}