GitHub PullRequestReviewCommentEvent at 2014-07-07 08:03:49
Repository: loop-server
Actor: ametaireau
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/mozilla-services/loop-server/pulls/comments/14584752","id":14584752,"diff_hunk":"@@ -35,23 +39,40 @@ function addHeaders(req, res, next) {\n   next();\n }\n \n-function logRequests(req, res, next) {\n-  var start =  new Date();\n-  res.on('finish', function() {\n-    var length = res._headers['content-length'] || \"\";\n-    var stop = new Date();\n-\n-    console.log(\n-      '[%s] \"%s %s HTTP/%s.%s\" %s %s — (%s ms)',\n-      strftime(conf.get(\"consoleDateFormat\"), start),\n-      req.method, req.url, req.httpVersionMajor, req.httpVersionMinor,\n-      res.statusCode, length, stop - start);\n-  });\n+\n+function metricsLog(req, res, next) {\n+  if (conf.get('metrics') === true) {\n+    var start =  new Date();\n+\n+    res.on('finish', function() {\n+    var ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress;","path":"loop/middlewares.js","position":35,"original_position":35,"commit_id":"d55c1118909c15f818facb6560e558751e9c83f2","original_commit_id":"a238cd55dd73186eeee890712505394411e0d8b6","user":{"login":"ametaireau","id":67073,"avatar_url":"https://avatars.githubusercontent.com/u/67073?","gravatar_id":"1b3ec4d4db1722e0459151ff9fd054f2","url":"https://api.github.com/users/ametaireau","html_url":"https://github.com/ametaireau","followers_url":"https://api.github.com/users/ametaireau/followers","following_url":"https://api.github.com/users/ametaireau/following{/other_user}","gists_url":"https://api.github.com/users/ametaireau/gists{/gist_id}","starred_url":"https://api.github.com/users/ametaireau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ametaireau/subscriptions","organizations_url":"https://api.github.com/users/ametaireau/orgs","repos_url":"https://api.github.com/users/ametaireau/repos","events_url":"https://api.github.com/users/ametaireau/events{/privacy}","received_events_url":"https://api.github.com/users/ametaireau/received_events","type":"User","site_admin":false},"body":"After the function declaration, we usually indent the block of code after, so this should look like that:\r\n```js\r\nres.on('finish', function(){\r\n  var ip = // etc\r\n```","created_at":"2014-07-07T08:03:49Z","updated_at":"2014-07-07T08:03:49Z","html_url":"https://github.com/mozilla-services/loop-server/pull/131#discussion_r14584752","pull_request_url":"https://api.github.com/repos/mozilla-services/loop-server/pulls/131","_links":{"self":{"href":"https://api.github.com/repos/mozilla-services/loop-server/pulls/comments/14584752"},"html":{"href":"https://github.com/mozilla-services/loop-server/pull/131#discussion_r14584752"},"pull_request":{"href":"https://api.github.com/repos/mozilla-services/loop-server/pulls/131"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla-services/loop-server/pulls/131","id":17791731,"html_url":"https://github.com/mozilla-services/loop-server/pull/131","diff_url":"https://github.com/mozilla-services/loop-server/pull/131.diff","patch_url":"https://github.com/mozilla-services/loop-server/pull/131.patch","issue_url":"https://api.github.com/repos/mozilla-services/loop-server/issues/131","number":131,"state":"open","title":"WIP - added a middleware to dump all requests info into the stdout","user":{"login":"tarekziade","id":250019,"avatar_url":"https://avatars.githubusercontent.com/u/250019?","gravatar_id":"b502021b659b0ea548b723e3b73e94d2","url":"https://api.github.com/users/tarekziade","html_url":"https://github.com/tarekziade","followers_url":"https://api.github.com/users/tarekziade/followers","following_url":"https://api.github.com/users/tarekziade/following{/other_user}","gists_url":"https://api.github.com/users/tarekziade/gists{/gist_id}","starred_url":"https://api.github.com/users/tarekziade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tarekziade/subscriptions","organizations_url":"https://api.github.com/users/tarekziade/orgs","repos_url":"https://api.github.com/users/tarekziade/repos","events_url":"https://api.github.com/users/tarekziade/events{/privacy}","received_events_url":"https://api.github.com/users/tarekziade/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-06-30T19:10:46Z","updated_at":"2014-07-07T08:03:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"58d0eabbdd339dd1e10eca9710217aa6776e0478","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla-services/loop-server/pulls/131/commits","review_comments_url":"https://api.github.com/repos/mozilla-services/loop-server/pulls/131/comments","review_comment_url":"https://api.github.com/repos/mozilla-services/loop-server/pulls/comments/{number}","comments_url":"https://api.github.com/repos/mozilla-services/loop-server/issues/131/comments","statuses_url":"https://api.github.com/repos/mozilla-services/loop-server/statuses/d55c1118909c15f818facb6560e558751e9c83f2","head":{"label":"mozilla-services:logging","ref":"logging","sha":"d55c1118909c15f818facb6560e558751e9c83f2","user":{"login":"mozilla-services","id":1066228,"avatar_url":"https://avatars.githubusercontent.com/u/1066228?","gravatar_id":"a41a81f9188770933a4b54382c29cae4","url":"https://api.github.com/users/mozilla-services","html_url":"https://github.com/mozilla-services","followers_url":"https://api.github.com/users/mozilla-services/followers","following_url":"https://api.github.com/users/mozilla-services/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-services/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-services/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-services/subscriptions","organizations_url":"https://api.github.com/users/mozilla-services/orgs","repos_url":"https://api.github.com/users/mozilla-services/repos","events_url":"https://api.github.com/users/mozilla-services/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-services/received_events","type":"Organization","site_admin":false},"repo":{"id":17026140,"name":"loop-server","full_name":"mozilla-services/loop-server","owner":{"login":"mozilla-services","id":1066228,"avatar_url":"https://avatars.githubusercontent.com/u/1066228?","gravatar_id":"a41a81f9188770933a4b54382c29cae4","url":"https://api.github.com/users/mozilla-services","html_url":"https://github.com/mozilla-services","followers_url":"https://api.github.com/users/mozilla-services/followers","following_url":"https://api.github.com/users/mozilla-services/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-services/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-services/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-services/subscriptions","organizations_url":"https://api.github.com/users/mozilla-services/orgs","repos_url":"https://api.github.com/users/mozilla-services/repos","events_url":"https://api.github.com/users/mozilla-services/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-services/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla-services/loop-server","description":"The mozilla loop server","fork":false,"url":"https://api.github.com/repos/mozilla-services/loop-server","forks_url":"https://api.github.com/repos/mozilla-services/loop-server/forks","keys_url":"https://api.github.com/repos/mozilla-services/loop-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-services/loop-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-services/loop-server/teams","hooks_url":"https://api.github.com/repos/mozilla-services/loop-server/hooks","issue_events_url":"https://api.github.com/repos/mozilla-services/loop-server/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-services/loop-server/events","assignees_url":"https://api.github.com/repos/mozilla-services/loop-server/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-services/loop-server/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-services/loop-server/tags","blobs_url":"https://api.github.com/repos/mozilla-services/loop-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-services/loop-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-services/loop-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-services/loop-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-services/loop-server/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-services/loop-server/languages","stargazers_url":"https://api.github.com/repos/mozilla-services/loop-server/stargazers","contributors_url":"https://api.github.com/repos/mozilla-services/loop-server/contributors","subscribers_url":"https://api.github.com/repos/mozilla-services/loop-server/subscribers","subscription_url":"https://api.github.com/repos/mozilla-services/loop-server/subscription","commits_url":"https://api.github.com/repos/mozilla-services/loop-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-services/loop-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-services/loop-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-services/loop-server/issues/comments/{number}","contents_url":"https://api.github.com/repos/mozilla-services/loop-server/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-services/loop-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-services/loop-server/merges","archive_url":"https://api.github.com/repos/mozilla-services/loop-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-services/loop-server/downloads","issues_url":"https://api.github.com/repos/mozilla-services/loop-server/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-services/loop-server/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-services/loop-server/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-services/loop-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-services/loop-server/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-services/loop-server/releases{/id}","created_at":"2014-02-20T16:02:00Z","updated_at":"2014-07-02T21:02:35Z","pushed_at":"2014-07-07T08:00:14Z","git_url":"git://github.com/mozilla-services/loop-server.git","ssh_url":"git@github.com:mozilla-services/loop-server.git","clone_url":"https://github.com/mozilla-services/loop-server.git","svn_url":"https://github.com/mozilla-services/loop-server","homepage":null,"size":8012,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"forks_count":4,"mirror_url":null,"open_issues_count":4,"forks":4,"open_issues":4,"watchers":4,"default_branch":"master"}},"base":{"label":"mozilla-services:master","ref":"master","sha":"203a483bf3fc307e19c736c590f6c18b451e0ccd","user":{"login":"mozilla-services","id":1066228,"avatar_url":"https://avatars.githubusercontent.com/u/1066228?","gravatar_id":"a41a81f9188770933a4b54382c29cae4","url":"https://api.github.com/users/mozilla-services","html_url":"https://github.com/mozilla-services","followers_url":"https://api.github.com/users/mozilla-services/followers","following_url":"https://api.github.com/users/mozilla-services/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-services/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-services/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-services/subscriptions","organizations_url":"https://api.github.com/users/mozilla-services/orgs","repos_url":"https://api.github.com/users/mozilla-services/repos","events_url":"https://api.github.com/users/mozilla-services/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-services/received_events","type":"Organization","site_admin":false},"repo":{"id":17026140,"name":"loop-server","full_name":"mozilla-services/loop-server","owner":{"login":"mozilla-services","id":1066228,"avatar_url":"https://avatars.githubusercontent.com/u/1066228?","gravatar_id":"a41a81f9188770933a4b54382c29cae4","url":"https://api.github.com/users/mozilla-services","html_url":"https://github.com/mozilla-services","followers_url":"https://api.github.com/users/mozilla-services/followers","following_url":"https://api.github.com/users/mozilla-services/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-services/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-services/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-services/subscriptions","organizations_url":"https://api.github.com/users/mozilla-services/orgs","repos_url":"https://api.github.com/users/mozilla-services/repos","events_url":"https://api.github.com/users/mozilla-services/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-services/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla-services/loop-server","description":"The mozilla loop server","fork":false,"url":"https://api.github.com/repos/mozilla-services/loop-server","forks_url":"https://api.github.com/repos/mozilla-services/loop-server/forks","keys_url":"https://api.github.com/repos/mozilla-services/loop-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-services/loop-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-services/loop-server/teams","hooks_url":"https://api.github.com/repos/mozilla-services/loop-server/hooks","issue_events_url":"https://api.github.com/repos/mozilla-services/loop-server/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-services/loop-server/events","assignees_url":"https://api.github.com/repos/mozilla-services/loop-server/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-services/loop-server/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-services/loop-server/tags","blobs_url":"https://api.github.com/repos/mozilla-services/loop-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-services/loop-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-services/loop-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-services/loop-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-services/loop-server/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-services/loop-server/languages","stargazers_url":"https://api.github.com/repos/mozilla-services/loop-server/stargazers","contributors_url":"https://api.github.com/repos/mozilla-services/loop-server/contributors","subscribers_url":"https://api.github.com/repos/mozilla-services/loop-server/subscribers","subscription_url":"https://api.github.com/repos/mozilla-services/loop-server/subscription","commits_url":"https://api.github.com/repos/mozilla-services/loop-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-services/loop-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-services/loop-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-services/loop-server/issues/comments/{number}","contents_url":"https://api.github.com/repos/mozilla-services/loop-server/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-services/loop-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-services/loop-server/merges","archive_url":"https://api.github.com/repos/mozilla-services/loop-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-services/loop-server/downloads","issues_url":"https://api.github.com/repos/mozilla-services/loop-server/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-services/loop-server/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-services/loop-server/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-services/loop-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-services/loop-server/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-services/loop-server/releases{/id}","created_at":"2014-02-20T16:02:00Z","updated_at":"2014-07-02T21:02:35Z","pushed_at":"2014-07-07T08:00:14Z","git_url":"git://github.com/mozilla-services/loop-server.git","ssh_url":"git@github.com:mozilla-services/loop-server.git","clone_url":"https://github.com/mozilla-services/loop-server.git","svn_url":"https://github.com/mozilla-services/loop-server","homepage":null,"size":8012,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"forks_count":4,"mirror_url":null,"open_issues_count":4,"forks":4,"open_issues":4,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla-services/loop-server/pulls/131"},"html":{"href":"https://github.com/mozilla-services/loop-server/pull/131"},"issue":{"href":"https://api.github.com/repos/mozilla-services/loop-server/issues/131"},"comments":{"href":"https://api.github.com/repos/mozilla-services/loop-server/issues/131/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla-services/loop-server/pulls/131/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla-services/loop-server/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/mozilla-services/loop-server/pulls/131/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla-services/loop-server/statuses/d55c1118909c15f818facb6560e558751e9c83f2"}}}}