{"action":"created","comment":{"url":"https://api.github.com/repos/uber-go/zap/pulls/comments/69787720","id":69787720,"diff_hunk":"@@ -0,0 +1,144 @@\n+// Copyright (c) 2016 Uber Technologies, Inc.\n+//\n+// Permission is hereby granted, free of charge, to any person obtaining a copy\n+// of this software and associated documentation files (the \"Software\"), to deal\n+// in the Software without restriction, including without limitation the rights\n+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n+// copies of the Software, and to permit persons to whom the Software is\n+// furnished to do so, subject to the following conditions:\n+//\n+// The above copyright notice and this permission notice shall be included in\n+// all copies or substantial portions of the Software.\n+//\n+// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n+// THE SOFTWARE.\n+\n+package zbark\n+\n+import (\n+\t\"github.com/uber-go/zap\"\n+\t\"github.com/uber-go/zap/zwrap\"\n+\n+\t\"github.com/uber-common/bark\"\n+)\n+\n+// Debarkify wraps bark.Logger to make it compatible with zap's JSON logger\n+func Debarkify(b bark.Logger) zap.Logger {\n+\tif wrapper, ok := b.(*barker); ok {\n+\t\treturn wrapper.zl\n+\t}\n+\treturn &zapper{\n+\t\tlvl: zap.DebugLevel,\n+\t\tbl:  b,\n+\t}\n+}\n+\n+type zapper struct {\n+\tlvl zap.Level\n+\tbl  bark.Logger\n+}\n+\n+func (z *zapper) DFatal(msg string, fields ...zap.Field) {\n+\t// TODO: Implement development/DFatal\n+\tz.Error(msg, fields...)\n+}\n+\n+func (z *zapper) Log(l zap.Level, msg string, fields ...zap.Field) {\n+\tif l < z.lvl {\n+\t\treturn\n+\t}\n+\tswitch l {\n+\tcase zap.DebugLevel:\n+\t\tz.Debug(msg, fields...)\n+\tcase zap.InfoLevel:\n+\t\tz.Info(msg, fields...)\n+\tcase zap.WarnLevel:\n+\t\tz.Warn(msg, fields...)\n+\tcase zap.ErrorLevel:\n+\t\tz.Error(msg, fields...)\n+\tcase zap.PanicLevel:\n+\t\tz.Panic(msg, fields...)\n+\tcase zap.FatalLevel:\n+\t\tz.Fatal(msg, fields...)\n+\tdefault:\n+\t\tpanic(\"passed an unknown zap.Level\")\n+\t}\n+}\n+\n+func (z *zapper) Level() zap.Level {\n+\treturn z.lvl\n+}\n+\n+// Change the level of this logger, as well as all its ancestors and\n+// descendants. This makes it easy to change the log level at runtime\n+// without restarting your application.\n+func (z *zapper) SetLevel(l zap.Level) {\n+\tz.lvl = l\n+}\n+\n+// Create a child logger, and optionally add some context to that logger.\n+func (z *zapper) With(fields ...zap.Field) zap.Logger {\n+\treturn &zapper{\n+\t\tlvl: z.lvl,\n+\t\tbl:  z.bl.WithFields(zapToBark(fields)),\n+\t}\n+}\n+\n+func (z *zapper) StubTime() {\n+\t// StubTime stops the logger from including the current time in each\n+\t// message. Instead, it always reports the time as Unix epoch 0. (This is\n+\t// useful in tests and examples.)\n+\tpanic(\"fake implementation\")\n+}\n+\n+func (z *zapper) Check(l zap.Level, msg string) *zap.CheckedMessage {\n+\tif l < z.lvl {\n+\t\treturn nil\n+\t}\n+\treturn zap.NewCheckedMessage(z, l, msg)\n+}\n+\n+type zapperBarkFields struct {\n+\tzwrap.KeyValueMap","path":"zbark/debark.go","position":107,"original_position":107,"commit_id":"aac12958a7d4d5c905d298d56763353015c01422","original_commit_id":"aac12958a7d4d5c905d298d56763353015c01422","user":{"login":"prashantv","id":140159,"avatar_url":"https://avatars.githubusercontent.com/u/140159?v=3","gravatar_id":"","url":"https://api.github.com/users/prashantv","html_url":"https://github.com/prashantv","followers_url":"https://api.github.com/users/prashantv/followers","following_url":"https://api.github.com/users/prashantv/following{/other_user}","gists_url":"https://api.github.com/users/prashantv/gists{/gist_id}","starred_url":"https://api.github.com/users/prashantv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prashantv/subscriptions","organizations_url":"https://api.github.com/users/prashantv/orgs","repos_url":"https://api.github.com/users/prashantv/repos","events_url":"https://api.github.com/users/prashantv/events{/privacy}","received_events_url":"https://api.github.com/users/prashantv/received_events","type":"User","site_admin":false},"body":"any reason why this is embedded?","created_at":"2016-07-06T18:42:18Z","updated_at":"2016-07-06T18:42:18Z","html_url":"https://github.com/uber-go/zap/pull/85#discussion_r69787720","pull_request_url":"https://api.github.com/repos/uber-go/zap/pulls/85","_links":{"self":{"href":"https://api.github.com/repos/uber-go/zap/pulls/comments/69787720"},"html":{"href":"https://github.com/uber-go/zap/pull/85#discussion_r69787720"},"pull_request":{"href":"https://api.github.com/repos/uber-go/zap/pulls/85"}}},"pull_request":{"url":"https://api.github.com/repos/uber-go/zap/pulls/85","id":75024532,"html_url":"https://github.com/uber-go/zap/pull/85","diff_url":"https://github.com/uber-go/zap/pull/85.diff","patch_url":"https://github.com/uber-go/zap/pull/85.patch","issue_url":"https://api.github.com/repos/uber-go/zap/issues/85","number":85,"state":"open","locked":false,"title":"Debarkify strawman","user":{"login":"billf","id":265988,"avatar_url":"https://avatars.githubusercontent.com/u/265988?v=3","gravatar_id":"","url":"https://api.github.com/users/billf","html_url":"https://github.com/billf","followers_url":"https://api.github.com/users/billf/followers","following_url":"https://api.github.com/users/billf/following{/other_user}","gists_url":"https://api.github.com/users/billf/gists{/gist_id}","starred_url":"https://api.github.com/users/billf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/billf/subscriptions","organizations_url":"https://api.github.com/users/billf/orgs","repos_url":"https://api.github.com/users/billf/repos","events_url":"https://api.github.com/users/billf/events{/privacy}","received_events_url":"https://api.github.com/users/billf/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-06-23T20:47:43Z","updated_at":"2016-07-06T18:42:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"94d8713ff0100f34b60b247e7f6fb6b95082b98a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/uber-go/zap/pulls/85/commits","review_comments_url":"https://api.github.com/repos/uber-go/zap/pulls/85/comments","review_comment_url":"https://api.github.com/repos/uber-go/zap/pulls/comments{/number}","comments_url":"https://api.github.com/repos/uber-go/zap/issues/85/comments","statuses_url":"https://api.github.com/repos/uber-go/zap/statuses/aac12958a7d4d5c905d298d56763353015c01422","head":{"label":"billf:debarkify","ref":"debarkify","sha":"aac12958a7d4d5c905d298d56763353015c01422","user":{"login":"billf","id":265988,"avatar_url":"https://avatars.githubusercontent.com/u/265988?v=3","gravatar_id":"","url":"https://api.github.com/users/billf","html_url":"https://github.com/billf","followers_url":"https://api.github.com/users/billf/followers","following_url":"https://api.github.com/users/billf/following{/other_user}","gists_url":"https://api.github.com/users/billf/gists{/gist_id}","starred_url":"https://api.github.com/users/billf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/billf/subscriptions","organizations_url":"https://api.github.com/users/billf/orgs","repos_url":"https://api.github.com/users/billf/repos","events_url":"https://api.github.com/users/billf/events{/privacy}","received_events_url":"https://api.github.com/users/billf/received_events","type":"User","site_admin":false},"repo":{"id":61581084,"name":"zap","full_name":"billf/zap","owner":{"login":"billf","id":265988,"avatar_url":"https://avatars.githubusercontent.com/u/265988?v=3","gravatar_id":"","url":"https://api.github.com/users/billf","html_url":"https://github.com/billf","followers_url":"https://api.github.com/users/billf/followers","following_url":"https://api.github.com/users/billf/following{/other_user}","gists_url":"https://api.github.com/users/billf/gists{/gist_id}","starred_url":"https://api.github.com/users/billf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/billf/subscriptions","organizations_url":"https://api.github.com/users/billf/orgs","repos_url":"https://api.github.com/users/billf/repos","events_url":"https://api.github.com/users/billf/events{/privacy}","received_events_url":"https://api.github.com/users/billf/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/billf/zap","description":"Fast, structured, leveled logging in Go","fork":true,"url":"https://api.github.com/repos/billf/zap","forks_url":"https://api.github.com/repos/billf/zap/forks","keys_url":"https://api.github.com/repos/billf/zap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/billf/zap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/billf/zap/teams","hooks_url":"https://api.github.com/repos/billf/zap/hooks","issue_events_url":"https://api.github.com/repos/billf/zap/issues/events{/number}","events_url":"https://api.github.com/repos/billf/zap/events","assignees_url":"https://api.github.com/repos/billf/zap/assignees{/user}","branches_url":"https://api.github.com/repos/billf/zap/branches{/branch}","tags_url":"https://api.github.com/repos/billf/zap/tags","blobs_url":"https://api.github.com/repos/billf/zap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/billf/zap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/billf/zap/git/refs{/sha}","trees_url":"https://api.github.com/repos/billf/zap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/billf/zap/statuses/{sha}","languages_url":"https://api.github.com/repos/billf/zap/languages","stargazers_url":"https://api.github.com/repos/billf/zap/stargazers","contributors_url":"https://api.github.com/repos/billf/zap/contributors","subscribers_url":"https://api.github.com/repos/billf/zap/subscribers","subscription_url":"https://api.github.com/repos/billf/zap/subscription","commits_url":"https://api.github.com/repos/billf/zap/commits{/sha}","git_commits_url":"https://api.github.com/repos/billf/zap/git/commits{/sha}","comments_url":"https://api.github.com/repos/billf/zap/comments{/number}","issue_comment_url":"https://api.github.com/repos/billf/zap/issues/comments{/number}","contents_url":"https://api.github.com/repos/billf/zap/contents/{+path}","compare_url":"https://api.github.com/repos/billf/zap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/billf/zap/merges","archive_url":"https://api.github.com/repos/billf/zap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/billf/zap/downloads","issues_url":"https://api.github.com/repos/billf/zap/issues{/number}","pulls_url":"https://api.github.com/repos/billf/zap/pulls{/number}","milestones_url":"https://api.github.com/repos/billf/zap/milestones{/number}","notifications_url":"https://api.github.com/repos/billf/zap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/billf/zap/labels{/name}","releases_url":"https://api.github.com/repos/billf/zap/releases{/id}","deployments_url":"https://api.github.com/repos/billf/zap/deployments","created_at":"2016-06-20T21:20:07Z","updated_at":"2016-06-20T21:20:08Z","pushed_at":"2016-06-30T21:32:30Z","git_url":"git://github.com/billf/zap.git","ssh_url":"git@github.com:billf/zap.git","clone_url":"https://github.com/billf/zap.git","svn_url":"https://github.com/billf/zap","homepage":"https://godoc.org/github.com/uber-go/zap","size":177,"stargazers_count":0,"watchers_count":0,"language":"Go","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":"uber-go:master","ref":"master","sha":"469a1280b2b59c39f5aed25f9b823f00c6fd3e16","user":{"login":"uber-go","id":19262598,"avatar_url":"https://avatars.githubusercontent.com/u/19262598?v=3","gravatar_id":"","url":"https://api.github.com/users/uber-go","html_url":"https://github.com/uber-go","followers_url":"https://api.github.com/users/uber-go/followers","following_url":"https://api.github.com/users/uber-go/following{/other_user}","gists_url":"https://api.github.com/users/uber-go/gists{/gist_id}","starred_url":"https://api.github.com/users/uber-go/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber-go/subscriptions","organizations_url":"https://api.github.com/users/uber-go/orgs","repos_url":"https://api.github.com/users/uber-go/repos","events_url":"https://api.github.com/users/uber-go/events{/privacy}","received_events_url":"https://api.github.com/users/uber-go/received_events","type":"Organization","site_admin":false},"repo":{"id":52034309,"name":"zap","full_name":"uber-go/zap","owner":{"login":"uber-go","id":19262598,"avatar_url":"https://avatars.githubusercontent.com/u/19262598?v=3","gravatar_id":"","url":"https://api.github.com/users/uber-go","html_url":"https://github.com/uber-go","followers_url":"https://api.github.com/users/uber-go/followers","following_url":"https://api.github.com/users/uber-go/following{/other_user}","gists_url":"https://api.github.com/users/uber-go/gists{/gist_id}","starred_url":"https://api.github.com/users/uber-go/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber-go/subscriptions","organizations_url":"https://api.github.com/users/uber-go/orgs","repos_url":"https://api.github.com/users/uber-go/repos","events_url":"https://api.github.com/users/uber-go/events{/privacy}","received_events_url":"https://api.github.com/users/uber-go/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uber-go/zap","description":"Fast, structured, leveled logging in Go","fork":false,"url":"https://api.github.com/repos/uber-go/zap","forks_url":"https://api.github.com/repos/uber-go/zap/forks","keys_url":"https://api.github.com/repos/uber-go/zap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uber-go/zap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uber-go/zap/teams","hooks_url":"https://api.github.com/repos/uber-go/zap/hooks","issue_events_url":"https://api.github.com/repos/uber-go/zap/issues/events{/number}","events_url":"https://api.github.com/repos/uber-go/zap/events","assignees_url":"https://api.github.com/repos/uber-go/zap/assignees{/user}","branches_url":"https://api.github.com/repos/uber-go/zap/branches{/branch}","tags_url":"https://api.github.com/repos/uber-go/zap/tags","blobs_url":"https://api.github.com/repos/uber-go/zap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uber-go/zap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uber-go/zap/git/refs{/sha}","trees_url":"https://api.github.com/repos/uber-go/zap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uber-go/zap/statuses/{sha}","languages_url":"https://api.github.com/repos/uber-go/zap/languages","stargazers_url":"https://api.github.com/repos/uber-go/zap/stargazers","contributors_url":"https://api.github.com/repos/uber-go/zap/contributors","subscribers_url":"https://api.github.com/repos/uber-go/zap/subscribers","subscription_url":"https://api.github.com/repos/uber-go/zap/subscription","commits_url":"https://api.github.com/repos/uber-go/zap/commits{/sha}","git_commits_url":"https://api.github.com/repos/uber-go/zap/git/commits{/sha}","comments_url":"https://api.github.com/repos/uber-go/zap/comments{/number}","issue_comment_url":"https://api.github.com/repos/uber-go/zap/issues/comments{/number}","contents_url":"https://api.github.com/repos/uber-go/zap/contents/{+path}","compare_url":"https://api.github.com/repos/uber-go/zap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uber-go/zap/merges","archive_url":"https://api.github.com/repos/uber-go/zap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uber-go/zap/downloads","issues_url":"https://api.github.com/repos/uber-go/zap/issues{/number}","pulls_url":"https://api.github.com/repos/uber-go/zap/pulls{/number}","milestones_url":"https://api.github.com/repos/uber-go/zap/milestones{/number}","notifications_url":"https://api.github.com/repos/uber-go/zap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uber-go/zap/labels{/name}","releases_url":"https://api.github.com/repos/uber-go/zap/releases{/id}","deployments_url":"https://api.github.com/repos/uber-go/zap/deployments","created_at":"2016-02-18T19:52:56Z","updated_at":"2016-07-06T18:12:09Z","pushed_at":"2016-07-06T01:21:38Z","git_url":"git://github.com/uber-go/zap.git","ssh_url":"git@github.com:uber-go/zap.git","clone_url":"https://github.com/uber-go/zap.git","svn_url":"https://github.com/uber-go/zap","homepage":"https://godoc.org/github.com/uber-go/zap","size":215,"stargazers_count":938,"watchers_count":938,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":41,"mirror_url":null,"open_issues_count":9,"forks":41,"open_issues":9,"watchers":938,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/uber-go/zap/pulls/85"},"html":{"href":"https://github.com/uber-go/zap/pull/85"},"issue":{"href":"https://api.github.com/repos/uber-go/zap/issues/85"},"comments":{"href":"https://api.github.com/repos/uber-go/zap/issues/85/comments"},"review_comments":{"href":"https://api.github.com/repos/uber-go/zap/pulls/85/comments"},"review_comment":{"href":"https://api.github.com/repos/uber-go/zap/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/uber-go/zap/pulls/85/commits"},"statuses":{"href":"https://api.github.com/repos/uber-go/zap/statuses/aac12958a7d4d5c905d298d56763353015c01422"}}}}
{"actor":{"display_login":"prashantv"}}