{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/pulls/comments/206322906","pull_request_review_id":141718217,"id":206322906,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNjMyMjkwNg==","diff_hunk":"@@ -18,9 +20,16 @@ export default class TelemetryReporter extends vscode.Disposable {\n     private static TELEMETRY_CONFIG_ID = 'telemetry';\n     private static TELEMETRY_CONFIG_ENABLED_ID = 'enableTelemetry';\n \n+    private logFilePath: string;\n+    private logStream: fs.WriteStream;\n+\n     constructor(private extensionId: string, private extensionVersion: string, key: string) {\n         super(() => this.toDispose.forEach((d) => d && d.dispose()))\n-\n+        this.logFilePath = process.env['VSCODE_LOGS'] || '';\n+        if (this.logFilePath) {\n+            this.logFilePath = path.join(this.logFilePath, `${extensionId}.txt`);\n+            this.logStream = fs.createWriteStream(this.logFilePath, { flags: 'a', encoding: 'utf8' });","path":"src/telemetryReporter.ts","position":null,"original_position":23,"commit_id":"a9f99d28bacb942edaf0fddd7d69b82ad1a9f0b9","original_commit_id":"5f8d1859311fe943148b9808898822831613e944","user":{"login":"ramya-rao-a","id":16890566,"node_id":"MDQ6VXNlcjE2ODkwNTY2","avatar_url":"https://avatars1.githubusercontent.com/u/16890566?v=4","gravatar_id":"","url":"https://api.github.com/users/ramya-rao-a","html_url":"https://github.com/ramya-rao-a","followers_url":"https://api.github.com/users/ramya-rao-a/followers","following_url":"https://api.github.com/users/ramya-rao-a/following{/other_user}","gists_url":"https://api.github.com/users/ramya-rao-a/gists{/gist_id}","starred_url":"https://api.github.com/users/ramya-rao-a/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ramya-rao-a/subscriptions","organizations_url":"https://api.github.com/users/ramya-rao-a/orgs","repos_url":"https://api.github.com/users/ramya-rao-a/repos","events_url":"https://api.github.com/users/ramya-rao-a/events{/privacy}","received_events_url":"https://api.github.com/users/ramya-rao-a/received_events","type":"User","site_admin":false},"body":"Done. I've used `end()` which will flush out all the pending writes. Then waited for it to \"finish\" before returning the promise in `dispose`","created_at":"2018-07-30T21:10:46Z","updated_at":"2018-07-30T21:10:46Z","html_url":"https://github.com/Microsoft/vscode-extension-telemetry/pull/21#discussion_r206322906","pull_request_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/pulls/21","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/pulls/comments/206322906"},"html":{"href":"https://github.com/Microsoft/vscode-extension-telemetry/pull/21#discussion_r206322906"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/pulls/21"}},"in_reply_to_id":206255982},"pull_request":{"url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/pulls/21","id":204008101,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA0MDA4MTAx","html_url":"https://github.com/Microsoft/vscode-extension-telemetry/pull/21","diff_url":"https://github.com/Microsoft/vscode-extension-telemetry/pull/21.diff","patch_url":"https://github.com/Microsoft/vscode-extension-telemetry/pull/21.patch","issue_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/issues/21","number":21,"state":"open","locked":false,"title":"Log telemetry events to file when in verbose mode","user":{"login":"ramya-rao-a","id":16890566,"node_id":"MDQ6VXNlcjE2ODkwNTY2","avatar_url":"https://avatars1.githubusercontent.com/u/16890566?v=4","gravatar_id":"","url":"https://api.github.com/users/ramya-rao-a","html_url":"https://github.com/ramya-rao-a","followers_url":"https://api.github.com/users/ramya-rao-a/followers","following_url":"https://api.github.com/users/ramya-rao-a/following{/other_user}","gists_url":"https://api.github.com/users/ramya-rao-a/gists{/gist_id}","starred_url":"https://api.github.com/users/ramya-rao-a/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ramya-rao-a/subscriptions","organizations_url":"https://api.github.com/users/ramya-rao-a/orgs","repos_url":"https://api.github.com/users/ramya-rao-a/repos","events_url":"https://api.github.com/users/ramya-rao-a/events{/privacy}","received_events_url":"https://api.github.com/users/ramya-rao-a/received_events","type":"User","site_admin":false},"body":"Log telemetry events to file when in verbose mode\r\nRelated to https://github.com/Microsoft/vscode/issues/54001\r\n- VSCODE_LOGS has the path to the log folder form https://github.com/Microsoft/vscode/blob/e7058655de73b5a19a5b4286079ce68cb7c13523/src/vs/platform/environment/node/environmentService.ts#L211\r\n- VSCODE_LOG_STACK tracks if verbose logging is enabled from https://github.com/Microsoft/vscode/blob/5fae91d61f12726e149fe5baed342eac2fbf8f88/src/vs/workbench/services/extensions/electron-browser/extensionHost.ts#L144. But since this gets enabled for insiders all the time, this is not a great choice for the current scenario.\r\n- So, we introduced a new env var VSCODE_LOG_LEVEL to pass the log level from core. See https://github.com/Microsoft/vscode/commit/9645f0219a5960a1b0df1cdf9dc20e1a7f646dd6\r\n\r\ncc @jrieken @bpasero ","created_at":"2018-07-26T01:55:05Z","updated_at":"2018-07-30T21:10:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"922d965ae473607e2f7b69ce685fbcdd3f1da126","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/pulls/21/commits","review_comments_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/pulls/21/comments","review_comment_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/issues/21/comments","statuses_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/statuses/a9f99d28bacb942edaf0fddd7d69b82ad1a9f0b9","head":{"label":"Microsoft:logs","ref":"logs","sha":"a9f99d28bacb942edaf0fddd7d69b82ad1a9f0b9","user":{"login":"Microsoft","id":6154722,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxNTQ3MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":51181395,"node_id":"MDEwOlJlcG9zaXRvcnk1MTE4MTM5NQ==","name":"vscode-extension-telemetry","full_name":"Microsoft/vscode-extension-telemetry","owner":{"login":"Microsoft","id":6154722,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxNTQ3MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/vscode-extension-telemetry","description":null,"fork":false,"url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry","forks_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/forks","keys_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/teams","hooks_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/events","assignees_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/tags","blobs_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/languages","stargazers_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/subscription","commits_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/merges","archive_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/downloads","issues_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/deployments","created_at":"2016-02-05T23:47:17Z","updated_at":"2018-07-09T22:35:22Z","pushed_at":"2018-07-30T21:05:46Z","git_url":"git://github.com/Microsoft/vscode-extension-telemetry.git","ssh_url":"git@github.com:Microsoft/vscode-extension-telemetry.git","clone_url":"https://github.com/Microsoft/vscode-extension-telemetry.git","svn_url":"https://github.com/Microsoft/vscode-extension-telemetry","homepage":null,"size":63,"stargazers_count":9,"watchers_count":9,"language":"TypeScript","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":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":9,"open_issues":4,"watchers":9,"default_branch":"master"}},"base":{"label":"Microsoft:master","ref":"master","sha":"0d8b34fcdbae27f5fcdd3e9f61f78a65a5e075ff","user":{"login":"Microsoft","id":6154722,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxNTQ3MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":51181395,"node_id":"MDEwOlJlcG9zaXRvcnk1MTE4MTM5NQ==","name":"vscode-extension-telemetry","full_name":"Microsoft/vscode-extension-telemetry","owner":{"login":"Microsoft","id":6154722,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxNTQ3MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/vscode-extension-telemetry","description":null,"fork":false,"url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry","forks_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/forks","keys_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/teams","hooks_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/events","assignees_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/tags","blobs_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/languages","stargazers_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/subscription","commits_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/merges","archive_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/downloads","issues_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/deployments","created_at":"2016-02-05T23:47:17Z","updated_at":"2018-07-09T22:35:22Z","pushed_at":"2018-07-30T21:05:46Z","git_url":"git://github.com/Microsoft/vscode-extension-telemetry.git","ssh_url":"git@github.com:Microsoft/vscode-extension-telemetry.git","clone_url":"https://github.com/Microsoft/vscode-extension-telemetry.git","svn_url":"https://github.com/Microsoft/vscode-extension-telemetry","homepage":null,"size":63,"stargazers_count":9,"watchers_count":9,"language":"TypeScript","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":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":9,"open_issues":4,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/pulls/21"},"html":{"href":"https://github.com/Microsoft/vscode-extension-telemetry/pull/21"},"issue":{"href":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/issues/21"},"comments":{"href":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/vscode-extension-telemetry/statuses/a9f99d28bacb942edaf0fddd7d69b82ad1a9f0b9"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"ramya-rao-a"}}