{"action":"created","comment":{"url":"https://api.github.com/repos/uber-common/zap/pulls/comments/63599182","id":63599182,"diff_hunk":"@@ -0,0 +1,36 @@\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 zap\n+\n+import (\n+\t\"testing\"\n+\n+\t\"github.com/stretchr/testify/assert\"\n+\t\"github.com/stretchr/testify/require\"\n+)\n+\n+func TestOptionDevelopment(t *testing.T) {\n+\tprod := NewJSON().(*jsonLogger)\n+\trequire.False(t, prod.development, \"Expected default logger to be in production mode.\")\n+\n+\tdev := NewJSON(Development()).(*jsonLogger)","path":"options_test.go","position":34,"original_position":34,"commit_id":"db8f7318e4359e3eaed968f55e4d20ad9322dd24","original_commit_id":"db8f7318e4359e3eaed968f55e4d20ad9322dd24","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":"It's an option you can pass when creating a logger:\r\nhttps://godoc.org/github.com/uber-common/zap#Development\r\n\r\nWe're using it to support the idea of `DFatal` which is an error log in production mode, but a fatal in test mode.","created_at":"2016-05-17T20:38:58Z","updated_at":"2016-05-17T20:38:58Z","html_url":"https://github.com/uber-common/zap/pull/46#discussion_r63599182","pull_request_url":"https://api.github.com/repos/uber-common/zap/pulls/46","_links":{"self":{"href":"https://api.github.com/repos/uber-common/zap/pulls/comments/63599182"},"html":{"href":"https://github.com/uber-common/zap/pull/46#discussion_r63599182"},"pull_request":{"href":"https://api.github.com/repos/uber-common/zap/pulls/46"}}},"pull_request":{"url":"https://api.github.com/repos/uber-common/zap/pulls/46","id":70370040,"html_url":"https://github.com/uber-common/zap/pull/46","diff_url":"https://github.com/uber-common/zap/pull/46.diff","patch_url":"https://github.com/uber-common/zap/pull/46.patch","issue_url":"https://api.github.com/repos/uber-common/zap/issues/46","number":46,"state":"open","locked":false,"title":"Add a test for Development option","user":{"login":"akshayjshah","id":972790,"avatar_url":"https://avatars.githubusercontent.com/u/972790?v=3","gravatar_id":"","url":"https://api.github.com/users/akshayjshah","html_url":"https://github.com/akshayjshah","followers_url":"https://api.github.com/users/akshayjshah/followers","following_url":"https://api.github.com/users/akshayjshah/following{/other_user}","gists_url":"https://api.github.com/users/akshayjshah/gists{/gist_id}","starred_url":"https://api.github.com/users/akshayjshah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akshayjshah/subscriptions","organizations_url":"https://api.github.com/users/akshayjshah/orgs","repos_url":"https://api.github.com/users/akshayjshah/repos","events_url":"https://api.github.com/users/akshayjshah/events{/privacy}","received_events_url":"https://api.github.com/users/akshayjshah/received_events","type":"User","site_admin":false},"body":"It's a bit hard to test this option, since its only effect is to sometimes call `os.Exit(1)`. I'm open to more elegant testing ideas...","created_at":"2016-05-17T14:46:01Z","updated_at":"2016-05-17T20:38:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dbf34009dba496d5201d9e2b2f797971408f6c1f","assignee":{"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},"milestone":null,"commits_url":"https://api.github.com/repos/uber-common/zap/pulls/46/commits","review_comments_url":"https://api.github.com/repos/uber-common/zap/pulls/46/comments","review_comment_url":"https://api.github.com/repos/uber-common/zap/pulls/comments{/number}","comments_url":"https://api.github.com/repos/uber-common/zap/issues/46/comments","statuses_url":"https://api.github.com/repos/uber-common/zap/statuses/db8f7318e4359e3eaed968f55e4d20ad9322dd24","head":{"label":"uber-common:ajs-tests","ref":"ajs-tests","sha":"db8f7318e4359e3eaed968f55e4d20ad9322dd24","user":{"login":"uber-common","id":14812045,"avatar_url":"https://avatars.githubusercontent.com/u/14812045?v=3","gravatar_id":"","url":"https://api.github.com/users/uber-common","html_url":"https://github.com/uber-common","followers_url":"https://api.github.com/users/uber-common/followers","following_url":"https://api.github.com/users/uber-common/following{/other_user}","gists_url":"https://api.github.com/users/uber-common/gists{/gist_id}","starred_url":"https://api.github.com/users/uber-common/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber-common/subscriptions","organizations_url":"https://api.github.com/users/uber-common/orgs","repos_url":"https://api.github.com/users/uber-common/repos","events_url":"https://api.github.com/users/uber-common/events{/privacy}","received_events_url":"https://api.github.com/users/uber-common/received_events","type":"Organization","site_admin":false},"repo":{"id":52034309,"name":"zap","full_name":"uber-common/zap","owner":{"login":"uber-common","id":14812045,"avatar_url":"https://avatars.githubusercontent.com/u/14812045?v=3","gravatar_id":"","url":"https://api.github.com/users/uber-common","html_url":"https://github.com/uber-common","followers_url":"https://api.github.com/users/uber-common/followers","following_url":"https://api.github.com/users/uber-common/following{/other_user}","gists_url":"https://api.github.com/users/uber-common/gists{/gist_id}","starred_url":"https://api.github.com/users/uber-common/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber-common/subscriptions","organizations_url":"https://api.github.com/users/uber-common/orgs","repos_url":"https://api.github.com/users/uber-common/repos","events_url":"https://api.github.com/users/uber-common/events{/privacy}","received_events_url":"https://api.github.com/users/uber-common/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uber-common/zap","description":"Fast, structured, leveled logging in Go","fork":false,"url":"https://api.github.com/repos/uber-common/zap","forks_url":"https://api.github.com/repos/uber-common/zap/forks","keys_url":"https://api.github.com/repos/uber-common/zap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uber-common/zap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uber-common/zap/teams","hooks_url":"https://api.github.com/repos/uber-common/zap/hooks","issue_events_url":"https://api.github.com/repos/uber-common/zap/issues/events{/number}","events_url":"https://api.github.com/repos/uber-common/zap/events","assignees_url":"https://api.github.com/repos/uber-common/zap/assignees{/user}","branches_url":"https://api.github.com/repos/uber-common/zap/branches{/branch}","tags_url":"https://api.github.com/repos/uber-common/zap/tags","blobs_url":"https://api.github.com/repos/uber-common/zap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uber-common/zap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uber-common/zap/git/refs{/sha}","trees_url":"https://api.github.com/repos/uber-common/zap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uber-common/zap/statuses/{sha}","languages_url":"https://api.github.com/repos/uber-common/zap/languages","stargazers_url":"https://api.github.com/repos/uber-common/zap/stargazers","contributors_url":"https://api.github.com/repos/uber-common/zap/contributors","subscribers_url":"https://api.github.com/repos/uber-common/zap/subscribers","subscription_url":"https://api.github.com/repos/uber-common/zap/subscription","commits_url":"https://api.github.com/repos/uber-common/zap/commits{/sha}","git_commits_url":"https://api.github.com/repos/uber-common/zap/git/commits{/sha}","comments_url":"https://api.github.com/repos/uber-common/zap/comments{/number}","issue_comment_url":"https://api.github.com/repos/uber-common/zap/issues/comments{/number}","contents_url":"https://api.github.com/repos/uber-common/zap/contents/{+path}","compare_url":"https://api.github.com/repos/uber-common/zap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uber-common/zap/merges","archive_url":"https://api.github.com/repos/uber-common/zap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uber-common/zap/downloads","issues_url":"https://api.github.com/repos/uber-common/zap/issues{/number}","pulls_url":"https://api.github.com/repos/uber-common/zap/pulls{/number}","milestones_url":"https://api.github.com/repos/uber-common/zap/milestones{/number}","notifications_url":"https://api.github.com/repos/uber-common/zap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uber-common/zap/labels{/name}","releases_url":"https://api.github.com/repos/uber-common/zap/releases{/id}","deployments_url":"https://api.github.com/repos/uber-common/zap/deployments","created_at":"2016-02-18T19:52:56Z","updated_at":"2016-05-17T19:27:55Z","pushed_at":"2016-05-17T14:46:02Z","git_url":"git://github.com/uber-common/zap.git","ssh_url":"git@github.com:uber-common/zap.git","clone_url":"https://github.com/uber-common/zap.git","svn_url":"https://github.com/uber-common/zap","homepage":"","size":138,"stargazers_count":142,"watchers_count":142,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":5,"forks":5,"open_issues":5,"watchers":142,"default_branch":"master"}},"base":{"label":"uber-common:master","ref":"master","sha":"f443fb58b924f5984c6600d2fd99bcb6451c8072","user":{"login":"uber-common","id":14812045,"avatar_url":"https://avatars.githubusercontent.com/u/14812045?v=3","gravatar_id":"","url":"https://api.github.com/users/uber-common","html_url":"https://github.com/uber-common","followers_url":"https://api.github.com/users/uber-common/followers","following_url":"https://api.github.com/users/uber-common/following{/other_user}","gists_url":"https://api.github.com/users/uber-common/gists{/gist_id}","starred_url":"https://api.github.com/users/uber-common/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber-common/subscriptions","organizations_url":"https://api.github.com/users/uber-common/orgs","repos_url":"https://api.github.com/users/uber-common/repos","events_url":"https://api.github.com/users/uber-common/events{/privacy}","received_events_url":"https://api.github.com/users/uber-common/received_events","type":"Organization","site_admin":false},"repo":{"id":52034309,"name":"zap","full_name":"uber-common/zap","owner":{"login":"uber-common","id":14812045,"avatar_url":"https://avatars.githubusercontent.com/u/14812045?v=3","gravatar_id":"","url":"https://api.github.com/users/uber-common","html_url":"https://github.com/uber-common","followers_url":"https://api.github.com/users/uber-common/followers","following_url":"https://api.github.com/users/uber-common/following{/other_user}","gists_url":"https://api.github.com/users/uber-common/gists{/gist_id}","starred_url":"https://api.github.com/users/uber-common/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber-common/subscriptions","organizations_url":"https://api.github.com/users/uber-common/orgs","repos_url":"https://api.github.com/users/uber-common/repos","events_url":"https://api.github.com/users/uber-common/events{/privacy}","received_events_url":"https://api.github.com/users/uber-common/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uber-common/zap","description":"Fast, structured, leveled logging in Go","fork":false,"url":"https://api.github.com/repos/uber-common/zap","forks_url":"https://api.github.com/repos/uber-common/zap/forks","keys_url":"https://api.github.com/repos/uber-common/zap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uber-common/zap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uber-common/zap/teams","hooks_url":"https://api.github.com/repos/uber-common/zap/hooks","issue_events_url":"https://api.github.com/repos/uber-common/zap/issues/events{/number}","events_url":"https://api.github.com/repos/uber-common/zap/events","assignees_url":"https://api.github.com/repos/uber-common/zap/assignees{/user}","branches_url":"https://api.github.com/repos/uber-common/zap/branches{/branch}","tags_url":"https://api.github.com/repos/uber-common/zap/tags","blobs_url":"https://api.github.com/repos/uber-common/zap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uber-common/zap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uber-common/zap/git/refs{/sha}","trees_url":"https://api.github.com/repos/uber-common/zap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uber-common/zap/statuses/{sha}","languages_url":"https://api.github.com/repos/uber-common/zap/languages","stargazers_url":"https://api.github.com/repos/uber-common/zap/stargazers","contributors_url":"https://api.github.com/repos/uber-common/zap/contributors","subscribers_url":"https://api.github.com/repos/uber-common/zap/subscribers","subscription_url":"https://api.github.com/repos/uber-common/zap/subscription","commits_url":"https://api.github.com/repos/uber-common/zap/commits{/sha}","git_commits_url":"https://api.github.com/repos/uber-common/zap/git/commits{/sha}","comments_url":"https://api.github.com/repos/uber-common/zap/comments{/number}","issue_comment_url":"https://api.github.com/repos/uber-common/zap/issues/comments{/number}","contents_url":"https://api.github.com/repos/uber-common/zap/contents/{+path}","compare_url":"https://api.github.com/repos/uber-common/zap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uber-common/zap/merges","archive_url":"https://api.github.com/repos/uber-common/zap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uber-common/zap/downloads","issues_url":"https://api.github.com/repos/uber-common/zap/issues{/number}","pulls_url":"https://api.github.com/repos/uber-common/zap/pulls{/number}","milestones_url":"https://api.github.com/repos/uber-common/zap/milestones{/number}","notifications_url":"https://api.github.com/repos/uber-common/zap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uber-common/zap/labels{/name}","releases_url":"https://api.github.com/repos/uber-common/zap/releases{/id}","deployments_url":"https://api.github.com/repos/uber-common/zap/deployments","created_at":"2016-02-18T19:52:56Z","updated_at":"2016-05-17T19:27:55Z","pushed_at":"2016-05-17T14:46:02Z","git_url":"git://github.com/uber-common/zap.git","ssh_url":"git@github.com:uber-common/zap.git","clone_url":"https://github.com/uber-common/zap.git","svn_url":"https://github.com/uber-common/zap","homepage":"","size":138,"stargazers_count":142,"watchers_count":142,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":5,"forks":5,"open_issues":5,"watchers":142,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/uber-common/zap/pulls/46"},"html":{"href":"https://github.com/uber-common/zap/pull/46"},"issue":{"href":"https://api.github.com/repos/uber-common/zap/issues/46"},"comments":{"href":"https://api.github.com/repos/uber-common/zap/issues/46/comments"},"review_comments":{"href":"https://api.github.com/repos/uber-common/zap/pulls/46/comments"},"review_comment":{"href":"https://api.github.com/repos/uber-common/zap/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/uber-common/zap/pulls/46/commits"},"statuses":{"href":"https://api.github.com/repos/uber-common/zap/statuses/db8f7318e4359e3eaed968f55e4d20ad9322dd24"}}}}