{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/msbuild/pulls/comments/103010842","pull_request_review_id":23788844,"id":103010842,"diff_hunk":"@@ -0,0 +1,136 @@\n+﻿using System;\n+using System.IO;\n+using System.IO.Compression;\n+using Microsoft.Build.Framework;\n+using Microsoft.Build.Shared;\n+\n+namespace Microsoft.Build.Logging\n+{\n+    /// <summary>\n+    /// A logger that serializes all incoming BuildEventArgs in a compressed binary file (*.binlog). The file\n+    /// can later be played back and piped into other loggers (file, console, etc) to reconstruct the log contents\n+    /// as if a real build was happening. Additionally, this format can be read by tools for\n+    /// analysis or visualization. Since the file format preserves structure, tools don't have to parse\n+    /// text logs that erase a lot of useful information.\n+    /// </summary>\n+    public class BinaryLogger : ILogger\n+    {\n+        private const int FileFormatVersion = 1;\n+\n+        private Stream stream;\n+        private BinaryWriter binaryWriter;\n+        private BuildEventArgsWriter eventArgsWriter;\n+\n+        private string FilePath { get; set; }\n+\n+        /// <summary>\n+        /// The binary logger Verbosity is always maximum (Diagnostic). It tries to capture as much\n+        /// information as possible.\n+        /// </summary>\n+        public LoggerVerbosity Verbosity { get; set; } = LoggerVerbosity.Diagnostic;","path":"src/Build/Logging/BinaryLogger/BinaryLogger.cs","position":30,"original_position":30,"commit_id":"310b3ed0d94f1835aff725fdf729779b9a42a175","original_commit_id":"9cfe2ffbceace6a65295430c419e3ab646d8c49f","user":{"login":"jeffkl","id":17556515,"avatar_url":"https://avatars.githubusercontent.com/u/17556515?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffkl","html_url":"https://github.com/jeffkl","followers_url":"https://api.github.com/users/jeffkl/followers","following_url":"https://api.github.com/users/jeffkl/following{/other_user}","gists_url":"https://api.github.com/users/jeffkl/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffkl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffkl/subscriptions","organizations_url":"https://api.github.com/users/jeffkl/orgs","repos_url":"https://api.github.com/users/jeffkl/repos","events_url":"https://api.github.com/users/jeffkl/events{/privacy}","received_events_url":"https://api.github.com/users/jeffkl/received_events","type":"User","site_admin":false},"body":"You might want to throw an exception in the setter if it must always be `Diagnostic`","created_at":"2017-02-24T19:10:13Z","updated_at":"2017-02-24T19:34:12Z","html_url":"https://github.com/Microsoft/msbuild/pull/1747#discussion_r103010842","pull_request_url":"https://api.github.com/repos/Microsoft/msbuild/pulls/1747","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/msbuild/pulls/comments/103010842"},"html":{"href":"https://github.com/Microsoft/msbuild/pull/1747#discussion_r103010842"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/msbuild/pulls/1747"}}},"pull_request":{"url":"https://api.github.com/repos/Microsoft/msbuild/pulls/1747","id":107741880,"html_url":"https://github.com/Microsoft/msbuild/pull/1747","diff_url":"https://github.com/Microsoft/msbuild/pull/1747.diff","patch_url":"https://github.com/Microsoft/msbuild/pull/1747.patch","issue_url":"https://api.github.com/repos/Microsoft/msbuild/issues/1747","number":1747,"state":"open","locked":false,"title":"Introduce a new BinaryLogger logger.","user":{"login":"KirillOsenkov","id":679326,"avatar_url":"https://avatars.githubusercontent.com/u/679326?v=3","gravatar_id":"","url":"https://api.github.com/users/KirillOsenkov","html_url":"https://github.com/KirillOsenkov","followers_url":"https://api.github.com/users/KirillOsenkov/followers","following_url":"https://api.github.com/users/KirillOsenkov/following{/other_user}","gists_url":"https://api.github.com/users/KirillOsenkov/gists{/gist_id}","starred_url":"https://api.github.com/users/KirillOsenkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KirillOsenkov/subscriptions","organizations_url":"https://api.github.com/users/KirillOsenkov/orgs","repos_url":"https://api.github.com/users/KirillOsenkov/repos","events_url":"https://api.github.com/users/KirillOsenkov/events{/privacy}","received_events_url":"https://api.github.com/users/KirillOsenkov/received_events","type":"User","site_admin":false},"body":"/binaryLogger[:output.binlog]\r\n\r\nSerializes all build events to a compressed binary file. By default the file is in the current directory and named \"msbuild.binlog\". The binary log is a detailed description of the build process that can later be used to reconstruct text logs and used by other analysis tools. A binary log is usually 10-20x smaller than the most detailed text diagnostic-level log, but it contains more information. (Short form: /bl or /binlog)\r\n\r\nExamples:\r\n  /bl\r\n  bl:output.binlog\r\n  binlog:..\\..\\custom.binlog\r\n  binaryLogger\r\n\r\nFor now this commit only includes the logger (writer), but the reader is disconnected. In subsequent PRs we will add an option to playback the binary log into any other set of existing loggers.\r\n\r\nSupport for the new format will be added to MSBuild Structured Log Viewer so that you can view the .binlog files.\r\n\r\nBuildEventArgsWriter and BuildEventArgsReader are general purpose custom binary serializers for BuildEventArgs objects.\r\n\r\nBinaryLogReplayEventSource is a way to playback events from the log to subscribers of IEventSource.\r\n\r\nA set of unit-tests is to follow in a separate PR.","created_at":"2017-02-24T00:12:09Z","updated_at":"2017-02-24T19:34:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8c19e012235d69b8a9ebae59b2ae81c326c5fabd","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/msbuild/pulls/1747/commits","review_comments_url":"https://api.github.com/repos/Microsoft/msbuild/pulls/1747/comments","review_comment_url":"https://api.github.com/repos/Microsoft/msbuild/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/msbuild/issues/1747/comments","statuses_url":"https://api.github.com/repos/Microsoft/msbuild/statuses/310b3ed0d94f1835aff725fdf729779b9a42a175","head":{"label":"KirillOsenkov:binarylogger","ref":"binarylogger","sha":"310b3ed0d94f1835aff725fdf729779b9a42a175","user":{"login":"KirillOsenkov","id":679326,"avatar_url":"https://avatars.githubusercontent.com/u/679326?v=3","gravatar_id":"","url":"https://api.github.com/users/KirillOsenkov","html_url":"https://github.com/KirillOsenkov","followers_url":"https://api.github.com/users/KirillOsenkov/followers","following_url":"https://api.github.com/users/KirillOsenkov/following{/other_user}","gists_url":"https://api.github.com/users/KirillOsenkov/gists{/gist_id}","starred_url":"https://api.github.com/users/KirillOsenkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KirillOsenkov/subscriptions","organizations_url":"https://api.github.com/users/KirillOsenkov/orgs","repos_url":"https://api.github.com/users/KirillOsenkov/repos","events_url":"https://api.github.com/users/KirillOsenkov/events{/privacy}","received_events_url":"https://api.github.com/users/KirillOsenkov/received_events","type":"User","site_admin":false},"repo":{"id":81614040,"name":"msbuild","full_name":"KirillOsenkov/msbuild","owner":{"login":"KirillOsenkov","id":679326,"avatar_url":"https://avatars.githubusercontent.com/u/679326?v=3","gravatar_id":"","url":"https://api.github.com/users/KirillOsenkov","html_url":"https://github.com/KirillOsenkov","followers_url":"https://api.github.com/users/KirillOsenkov/followers","following_url":"https://api.github.com/users/KirillOsenkov/following{/other_user}","gists_url":"https://api.github.com/users/KirillOsenkov/gists{/gist_id}","starred_url":"https://api.github.com/users/KirillOsenkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KirillOsenkov/subscriptions","organizations_url":"https://api.github.com/users/KirillOsenkov/orgs","repos_url":"https://api.github.com/users/KirillOsenkov/repos","events_url":"https://api.github.com/users/KirillOsenkov/events{/privacy}","received_events_url":"https://api.github.com/users/KirillOsenkov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/KirillOsenkov/msbuild","description":"The Microsoft Build Engine (MSBuild) is the build platform for .NET and Visual Studio.","fork":true,"url":"https://api.github.com/repos/KirillOsenkov/msbuild","forks_url":"https://api.github.com/repos/KirillOsenkov/msbuild/forks","keys_url":"https://api.github.com/repos/KirillOsenkov/msbuild/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KirillOsenkov/msbuild/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KirillOsenkov/msbuild/teams","hooks_url":"https://api.github.com/repos/KirillOsenkov/msbuild/hooks","issue_events_url":"https://api.github.com/repos/KirillOsenkov/msbuild/issues/events{/number}","events_url":"https://api.github.com/repos/KirillOsenkov/msbuild/events","assignees_url":"https://api.github.com/repos/KirillOsenkov/msbuild/assignees{/user}","branches_url":"https://api.github.com/repos/KirillOsenkov/msbuild/branches{/branch}","tags_url":"https://api.github.com/repos/KirillOsenkov/msbuild/tags","blobs_url":"https://api.github.com/repos/KirillOsenkov/msbuild/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KirillOsenkov/msbuild/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KirillOsenkov/msbuild/git/refs{/sha}","trees_url":"https://api.github.com/repos/KirillOsenkov/msbuild/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KirillOsenkov/msbuild/statuses/{sha}","languages_url":"https://api.github.com/repos/KirillOsenkov/msbuild/languages","stargazers_url":"https://api.github.com/repos/KirillOsenkov/msbuild/stargazers","contributors_url":"https://api.github.com/repos/KirillOsenkov/msbuild/contributors","subscribers_url":"https://api.github.com/repos/KirillOsenkov/msbuild/subscribers","subscription_url":"https://api.github.com/repos/KirillOsenkov/msbuild/subscription","commits_url":"https://api.github.com/repos/KirillOsenkov/msbuild/commits{/sha}","git_commits_url":"https://api.github.com/repos/KirillOsenkov/msbuild/git/commits{/sha}","comments_url":"https://api.github.com/repos/KirillOsenkov/msbuild/comments{/number}","issue_comment_url":"https://api.github.com/repos/KirillOsenkov/msbuild/issues/comments{/number}","contents_url":"https://api.github.com/repos/KirillOsenkov/msbuild/contents/{+path}","compare_url":"https://api.github.com/repos/KirillOsenkov/msbuild/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KirillOsenkov/msbuild/merges","archive_url":"https://api.github.com/repos/KirillOsenkov/msbuild/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KirillOsenkov/msbuild/downloads","issues_url":"https://api.github.com/repos/KirillOsenkov/msbuild/issues{/number}","pulls_url":"https://api.github.com/repos/KirillOsenkov/msbuild/pulls{/number}","milestones_url":"https://api.github.com/repos/KirillOsenkov/msbuild/milestones{/number}","notifications_url":"https://api.github.com/repos/KirillOsenkov/msbuild/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KirillOsenkov/msbuild/labels{/name}","releases_url":"https://api.github.com/repos/KirillOsenkov/msbuild/releases{/id}","deployments_url":"https://api.github.com/repos/KirillOsenkov/msbuild/deployments","created_at":"2017-02-10T22:50:08Z","updated_at":"2017-02-10T22:50:16Z","pushed_at":"2017-02-24T19:33:41Z","git_url":"git://github.com/KirillOsenkov/msbuild.git","ssh_url":"git@github.com:KirillOsenkov/msbuild.git","clone_url":"https://github.com/KirillOsenkov/msbuild.git","svn_url":"https://github.com/KirillOsenkov/msbuild","homepage":null,"size":17064,"stargazers_count":0,"watchers_count":0,"language":"C#","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":"xplat"}},"base":{"label":"Microsoft:xplat","ref":"xplat","sha":"fdbf2d358238e8236383e81acb353937161dae29","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","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":32051890,"name":"msbuild","full_name":"Microsoft/msbuild","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","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/msbuild","description":"The Microsoft Build Engine (MSBuild) is the build platform for .NET and Visual Studio.","fork":false,"url":"https://api.github.com/repos/Microsoft/msbuild","forks_url":"https://api.github.com/repos/Microsoft/msbuild/forks","keys_url":"https://api.github.com/repos/Microsoft/msbuild/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/msbuild/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/msbuild/teams","hooks_url":"https://api.github.com/repos/Microsoft/msbuild/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/msbuild/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/msbuild/events","assignees_url":"https://api.github.com/repos/Microsoft/msbuild/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/msbuild/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/msbuild/tags","blobs_url":"https://api.github.com/repos/Microsoft/msbuild/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/msbuild/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/msbuild/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/msbuild/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/msbuild/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/msbuild/languages","stargazers_url":"https://api.github.com/repos/Microsoft/msbuild/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/msbuild/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/msbuild/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/msbuild/subscription","commits_url":"https://api.github.com/repos/Microsoft/msbuild/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/msbuild/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/msbuild/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/msbuild/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/msbuild/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/msbuild/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/msbuild/merges","archive_url":"https://api.github.com/repos/Microsoft/msbuild/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/msbuild/downloads","issues_url":"https://api.github.com/repos/Microsoft/msbuild/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/msbuild/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/msbuild/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/msbuild/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/msbuild/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/msbuild/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/msbuild/deployments","created_at":"2015-03-12T02:04:46Z","updated_at":"2017-02-24T06:51:00Z","pushed_at":"2017-02-24T19:33:42Z","git_url":"git://github.com/Microsoft/msbuild.git","ssh_url":"git@github.com:Microsoft/msbuild.git","clone_url":"https://github.com/Microsoft/msbuild.git","svn_url":"https://github.com/Microsoft/msbuild","homepage":null,"size":17065,"stargazers_count":2897,"watchers_count":2897,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":615,"mirror_url":null,"open_issues_count":417,"forks":615,"open_issues":417,"watchers":2897,"default_branch":"xplat"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/msbuild/pulls/1747"},"html":{"href":"https://github.com/Microsoft/msbuild/pull/1747"},"issue":{"href":"https://api.github.com/repos/Microsoft/msbuild/issues/1747"},"comments":{"href":"https://api.github.com/repos/Microsoft/msbuild/issues/1747/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/msbuild/pulls/1747/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/msbuild/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/msbuild/pulls/1747/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/msbuild/statuses/310b3ed0d94f1835aff725fdf729779b9a42a175"}}}}
{"actor":{"display_login":"jeffkl"}}