{"action":"created","comment":{"url":"https://api.github.com/repos/uber-go/fx/pulls/comments/87943580","pull_request_review_id":8532816,"id":87943580,"diff_hunk":"@@ -0,0 +1,169 @@\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 ulog\n+\n+import (\n+\t\"io\"\n+\t\"io/ioutil\"\n+\t\"os\"\n+\t\"path\"\n+\t\"strings\"\n+\n+\t\"go.uber.org/fx/core/config\"\n+\n+\t\"github.com/uber-go/zap\"\n+)\n+\n+// Configuration for logging with uberfx\n+type Configuration struct {\n+\tLevel   string\n+\tFile    *FileConfiguration\n+\tStdout  bool\n+\tVerbose bool\n+\n+\tprefixWithFileLine *bool `yaml:\"prefix_with_fileline\"`\n+\tTextFormatter      *bool // use TextFormatter (default json)\n+}\n+\n+// FileConfiguration describes the properties needed to log to a file\n+type FileConfiguration struct {\n+\tEnabled   bool\n+\tDirectory string\n+\tFileName  string\n+}","path":"core/ulog/builder.go","position":51,"original_position":51,"commit_id":"6ba9a3c539fcf5561de7bb3ee199619aed107337","original_commit_id":"6ba9a3c539fcf5561de7bb3ee199619aed107337","user":{"login":"yurishkuro","id":3523016,"avatar_url":"https://avatars.githubusercontent.com/u/3523016?v=3","gravatar_id":"","url":"https://api.github.com/users/yurishkuro","html_url":"https://github.com/yurishkuro","followers_url":"https://api.github.com/users/yurishkuro/followers","following_url":"https://api.github.com/users/yurishkuro/following{/other_user}","gists_url":"https://api.github.com/users/yurishkuro/gists{/gist_id}","starred_url":"https://api.github.com/users/yurishkuro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yurishkuro/subscriptions","organizations_url":"https://api.github.com/users/yurishkuro/orgs","repos_url":"https://api.github.com/users/yurishkuro/repos","events_url":"https://api.github.com/users/yurishkuro/events{/privacy}","received_events_url":"https://api.github.com/users/yurishkuro/received_events","type":"User","site_admin":false},"body":"who is responsible for rotating the log?","created_at":"2016-11-15T03:48:06Z","updated_at":"2016-11-15T03:55:29Z","html_url":"https://github.com/uber-go/fx/pull/67#discussion_r87943580","pull_request_url":"https://api.github.com/repos/uber-go/fx/pulls/67","_links":{"self":{"href":"https://api.github.com/repos/uber-go/fx/pulls/comments/87943580"},"html":{"href":"https://github.com/uber-go/fx/pull/67#discussion_r87943580"},"pull_request":{"href":"https://api.github.com/repos/uber-go/fx/pulls/67"}}},"pull_request":{"url":"https://api.github.com/repos/uber-go/fx/pulls/67","id":93690032,"html_url":"https://github.com/uber-go/fx/pull/67","diff_url":"https://github.com/uber-go/fx/pull/67.diff","patch_url":"https://github.com/uber-go/fx/pull/67.patch","issue_url":"https://api.github.com/repos/uber-go/fx/issues/67","number":67,"state":"open","locked":false,"title":"Refactored ulog into Builder pattern","user":{"login":"anuptalwalkar","id":11004015,"avatar_url":"https://avatars.githubusercontent.com/u/11004015?v=3","gravatar_id":"","url":"https://api.github.com/users/anuptalwalkar","html_url":"https://github.com/anuptalwalkar","followers_url":"https://api.github.com/users/anuptalwalkar/followers","following_url":"https://api.github.com/users/anuptalwalkar/following{/other_user}","gists_url":"https://api.github.com/users/anuptalwalkar/gists{/gist_id}","starred_url":"https://api.github.com/users/anuptalwalkar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anuptalwalkar/subscriptions","organizations_url":"https://api.github.com/users/anuptalwalkar/orgs","repos_url":"https://api.github.com/users/anuptalwalkar/repos","events_url":"https://api.github.com/users/anuptalwalkar/events{/privacy}","received_events_url":"https://api.github.com/users/anuptalwalkar/received_events","type":"User","site_admin":false},"body":"GFM-146\r\nGFM-172\r\n\r\nI have updated ulog to follow builder pattern. With ulog.Builder, SetLogger, SetLevel and Configure can only be called on LogBuilder. This simplifies the Log interface, and makes Log object more robust. Also cleaned up how Configure() works for development and non-development setup. \r\n\r\nRemoved initFields() for performance, which were mostly used on Logger initialization.  \r\n","created_at":"2016-11-15T02:33:23Z","updated_at":"2016-11-15T03:55:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d0815dbabae7229c458afe69491bff2009bf4d49","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/uber-go/fx/pulls/67/commits","review_comments_url":"https://api.github.com/repos/uber-go/fx/pulls/67/comments","review_comment_url":"https://api.github.com/repos/uber-go/fx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/uber-go/fx/issues/67/comments","statuses_url":"https://api.github.com/repos/uber-go/fx/statuses/6ba9a3c539fcf5561de7bb3ee199619aed107337","head":{"label":"uber-go:log-refactor","ref":"log-refactor","sha":"6ba9a3c539fcf5561de7bb3ee199619aed107337","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":72056048,"name":"fx","full_name":"uber-go/fx","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/fx","description":"[ALPHA QUALITY] Service Framework","fork":false,"url":"https://api.github.com/repos/uber-go/fx","forks_url":"https://api.github.com/repos/uber-go/fx/forks","keys_url":"https://api.github.com/repos/uber-go/fx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uber-go/fx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uber-go/fx/teams","hooks_url":"https://api.github.com/repos/uber-go/fx/hooks","issue_events_url":"https://api.github.com/repos/uber-go/fx/issues/events{/number}","events_url":"https://api.github.com/repos/uber-go/fx/events","assignees_url":"https://api.github.com/repos/uber-go/fx/assignees{/user}","branches_url":"https://api.github.com/repos/uber-go/fx/branches{/branch}","tags_url":"https://api.github.com/repos/uber-go/fx/tags","blobs_url":"https://api.github.com/repos/uber-go/fx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uber-go/fx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uber-go/fx/git/refs{/sha}","trees_url":"https://api.github.com/repos/uber-go/fx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uber-go/fx/statuses/{sha}","languages_url":"https://api.github.com/repos/uber-go/fx/languages","stargazers_url":"https://api.github.com/repos/uber-go/fx/stargazers","contributors_url":"https://api.github.com/repos/uber-go/fx/contributors","subscribers_url":"https://api.github.com/repos/uber-go/fx/subscribers","subscription_url":"https://api.github.com/repos/uber-go/fx/subscription","commits_url":"https://api.github.com/repos/uber-go/fx/commits{/sha}","git_commits_url":"https://api.github.com/repos/uber-go/fx/git/commits{/sha}","comments_url":"https://api.github.com/repos/uber-go/fx/comments{/number}","issue_comment_url":"https://api.github.com/repos/uber-go/fx/issues/comments{/number}","contents_url":"https://api.github.com/repos/uber-go/fx/contents/{+path}","compare_url":"https://api.github.com/repos/uber-go/fx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uber-go/fx/merges","archive_url":"https://api.github.com/repos/uber-go/fx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uber-go/fx/downloads","issues_url":"https://api.github.com/repos/uber-go/fx/issues{/number}","pulls_url":"https://api.github.com/repos/uber-go/fx/pulls{/number}","milestones_url":"https://api.github.com/repos/uber-go/fx/milestones{/number}","notifications_url":"https://api.github.com/repos/uber-go/fx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uber-go/fx/labels{/name}","releases_url":"https://api.github.com/repos/uber-go/fx/releases{/id}","deployments_url":"https://api.github.com/repos/uber-go/fx/deployments","created_at":"2016-10-27T00:25:00Z","updated_at":"2016-11-14T08:18:19Z","pushed_at":"2016-11-15T02:33:23Z","git_url":"git://github.com/uber-go/fx.git","ssh_url":"git@github.com:uber-go/fx.git","clone_url":"https://github.com/uber-go/fx.git","svn_url":"https://github.com/uber-go/fx","homepage":null,"size":510,"stargazers_count":14,"watchers_count":14,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":14,"default_branch":"master"}},"base":{"label":"uber-go:master","ref":"master","sha":"b8d647abc9fdadab5105d94de5bc4495b28a86df","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":72056048,"name":"fx","full_name":"uber-go/fx","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/fx","description":"[ALPHA QUALITY] Service Framework","fork":false,"url":"https://api.github.com/repos/uber-go/fx","forks_url":"https://api.github.com/repos/uber-go/fx/forks","keys_url":"https://api.github.com/repos/uber-go/fx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uber-go/fx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uber-go/fx/teams","hooks_url":"https://api.github.com/repos/uber-go/fx/hooks","issue_events_url":"https://api.github.com/repos/uber-go/fx/issues/events{/number}","events_url":"https://api.github.com/repos/uber-go/fx/events","assignees_url":"https://api.github.com/repos/uber-go/fx/assignees{/user}","branches_url":"https://api.github.com/repos/uber-go/fx/branches{/branch}","tags_url":"https://api.github.com/repos/uber-go/fx/tags","blobs_url":"https://api.github.com/repos/uber-go/fx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uber-go/fx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uber-go/fx/git/refs{/sha}","trees_url":"https://api.github.com/repos/uber-go/fx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uber-go/fx/statuses/{sha}","languages_url":"https://api.github.com/repos/uber-go/fx/languages","stargazers_url":"https://api.github.com/repos/uber-go/fx/stargazers","contributors_url":"https://api.github.com/repos/uber-go/fx/contributors","subscribers_url":"https://api.github.com/repos/uber-go/fx/subscribers","subscription_url":"https://api.github.com/repos/uber-go/fx/subscription","commits_url":"https://api.github.com/repos/uber-go/fx/commits{/sha}","git_commits_url":"https://api.github.com/repos/uber-go/fx/git/commits{/sha}","comments_url":"https://api.github.com/repos/uber-go/fx/comments{/number}","issue_comment_url":"https://api.github.com/repos/uber-go/fx/issues/comments{/number}","contents_url":"https://api.github.com/repos/uber-go/fx/contents/{+path}","compare_url":"https://api.github.com/repos/uber-go/fx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uber-go/fx/merges","archive_url":"https://api.github.com/repos/uber-go/fx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uber-go/fx/downloads","issues_url":"https://api.github.com/repos/uber-go/fx/issues{/number}","pulls_url":"https://api.github.com/repos/uber-go/fx/pulls{/number}","milestones_url":"https://api.github.com/repos/uber-go/fx/milestones{/number}","notifications_url":"https://api.github.com/repos/uber-go/fx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uber-go/fx/labels{/name}","releases_url":"https://api.github.com/repos/uber-go/fx/releases{/id}","deployments_url":"https://api.github.com/repos/uber-go/fx/deployments","created_at":"2016-10-27T00:25:00Z","updated_at":"2016-11-14T08:18:19Z","pushed_at":"2016-11-15T02:33:23Z","git_url":"git://github.com/uber-go/fx.git","ssh_url":"git@github.com:uber-go/fx.git","clone_url":"https://github.com/uber-go/fx.git","svn_url":"https://github.com/uber-go/fx","homepage":null,"size":510,"stargazers_count":14,"watchers_count":14,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/uber-go/fx/pulls/67"},"html":{"href":"https://github.com/uber-go/fx/pull/67"},"issue":{"href":"https://api.github.com/repos/uber-go/fx/issues/67"},"comments":{"href":"https://api.github.com/repos/uber-go/fx/issues/67/comments"},"review_comments":{"href":"https://api.github.com/repos/uber-go/fx/pulls/67/comments"},"review_comment":{"href":"https://api.github.com/repos/uber-go/fx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/uber-go/fx/pulls/67/commits"},"statuses":{"href":"https://api.github.com/repos/uber-go/fx/statuses/6ba9a3c539fcf5561de7bb3ee199619aed107337"}}}}
{"actor":{"display_login":"yurishkuro"}}