{"action":"created","comment":{"url":"https://api.github.com/repos/aspnet/Logging/pulls/comments/36225795","id":36225795,"diff_hunk":"@@ -97,5 +99,26 @@ private static bool HasDefaultSwitch(DiagnosticsTraceSource traceSource)\n             return string.IsNullOrEmpty(traceSource.Switch.DisplayName) == string.IsNullOrEmpty(traceSource.Name) &&\n                 traceSource.Switch.Level == SourceLevels.Off;\n         }\n+\n+\n+        protected virtual void Dispose(bool disposing)\n+        {\n+            if (!_disposed)\n+            {\n+                if (disposing)\n+                {\n+                    _rootTraceListener.Flush();\n+                    _rootTraceListener.Dispose();\n+                }\n+\n+                _disposed = true;\n+            }\n+        }\n+\n+        public void Dispose()\n+        {\n+            Dispose(true);\n+            GC.SuppressFinalize(this);","path":"src/Microsoft.Framework.Logging.TraceSource/TraceSourceLoggerProvider.cs","position":40,"original_position":40,"commit_id":"8dd38a0a8372605510b0a6f8ec7dbb475d71afc8","original_commit_id":"8dd38a0a8372605510b0a6f8ec7dbb475d71afc8","user":{"login":"Tratcher","id":1821173,"avatar_url":"https://avatars.githubusercontent.com/u/1821173?v=3","gravatar_id":"","url":"https://api.github.com/users/Tratcher","html_url":"https://github.com/Tratcher","followers_url":"https://api.github.com/users/Tratcher/followers","following_url":"https://api.github.com/users/Tratcher/following{/other_user}","gists_url":"https://api.github.com/users/Tratcher/gists{/gist_id}","starred_url":"https://api.github.com/users/Tratcher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tratcher/subscriptions","organizations_url":"https://api.github.com/users/Tratcher/orgs","repos_url":"https://api.github.com/users/Tratcher/repos","events_url":"https://api.github.com/users/Tratcher/events{/privacy}","received_events_url":"https://api.github.com/users/Tratcher/received_events","type":"User","site_admin":false},"body":"Note that the entire msdn write-up is discussing native resources, safe handles, finalizers, etc.. We're not doing any of that, nor do we expect anyone to derive from these types and do it.  We don't need any more than:\r\n```c#\r\npublic void Dispose()\r\n{\r\n  if (!disposed)\r\n  {\r\n    _disposed = true;\r\n    _rootTraceListener.Flush();\r\n    _rootTraceListener.Dispose();\r\n  }\r\n}\r\n```\r\nThat said, I don't recommend marking it sealed either, there's no reason to forbid someone from deriving from it.","created_at":"2015-08-04T18:42:26Z","updated_at":"2015-08-04T18:42:26Z","html_url":"https://github.com/aspnet/Logging/pull/162#discussion_r36225795","pull_request_url":"https://api.github.com/repos/aspnet/Logging/pulls/162","_links":{"self":{"href":"https://api.github.com/repos/aspnet/Logging/pulls/comments/36225795"},"html":{"href":"https://github.com/aspnet/Logging/pull/162#discussion_r36225795"},"pull_request":{"href":"https://api.github.com/repos/aspnet/Logging/pulls/162"}}},"pull_request":{"url":"https://api.github.com/repos/aspnet/Logging/pulls/162","id":32457839,"html_url":"https://github.com/aspnet/Logging/pull/162","diff_url":"https://github.com/aspnet/Logging/pull/162.diff","patch_url":"https://github.com/aspnet/Logging/pull/162.patch","issue_url":"https://api.github.com/repos/aspnet/Logging/issues/162","number":162,"state":"open","locked":false,"title":"Issue #99 : Dispose ILoggerProvider ","user":{"login":"ycrumeyrolle","id":1958836,"avatar_url":"https://avatars.githubusercontent.com/u/1958836?v=3","gravatar_id":"","url":"https://api.github.com/users/ycrumeyrolle","html_url":"https://github.com/ycrumeyrolle","followers_url":"https://api.github.com/users/ycrumeyrolle/followers","following_url":"https://api.github.com/users/ycrumeyrolle/following{/other_user}","gists_url":"https://api.github.com/users/ycrumeyrolle/gists{/gist_id}","starred_url":"https://api.github.com/users/ycrumeyrolle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ycrumeyrolle/subscriptions","organizations_url":"https://api.github.com/users/ycrumeyrolle/orgs","repos_url":"https://api.github.com/users/ycrumeyrolle/repos","events_url":"https://api.github.com/users/ycrumeyrolle/events{/privacy}","received_events_url":"https://api.github.com/users/ycrumeyrolle/received_events","type":"User","site_admin":false},"body":" - LoggerFactory disposes its providers\r\n - TraceSourceLoggerProvider flush & dispose its root TraceListener\r\n","created_at":"2015-04-01T20:34:14Z","updated_at":"2015-08-04T18:42:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"41de4221a8d15aa57a052bad2bcdcdb653cb0518","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/aspnet/Logging/pulls/162/commits","review_comments_url":"https://api.github.com/repos/aspnet/Logging/pulls/162/comments","review_comment_url":"https://api.github.com/repos/aspnet/Logging/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aspnet/Logging/issues/162/comments","statuses_url":"https://api.github.com/repos/aspnet/Logging/statuses/8dd38a0a8372605510b0a6f8ec7dbb475d71afc8","head":{"label":"ycrumeyrolle:dev","ref":"dev","sha":"8dd38a0a8372605510b0a6f8ec7dbb475d71afc8","user":{"login":"ycrumeyrolle","id":1958836,"avatar_url":"https://avatars.githubusercontent.com/u/1958836?v=3","gravatar_id":"","url":"https://api.github.com/users/ycrumeyrolle","html_url":"https://github.com/ycrumeyrolle","followers_url":"https://api.github.com/users/ycrumeyrolle/followers","following_url":"https://api.github.com/users/ycrumeyrolle/following{/other_user}","gists_url":"https://api.github.com/users/ycrumeyrolle/gists{/gist_id}","starred_url":"https://api.github.com/users/ycrumeyrolle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ycrumeyrolle/subscriptions","organizations_url":"https://api.github.com/users/ycrumeyrolle/orgs","repos_url":"https://api.github.com/users/ycrumeyrolle/repos","events_url":"https://api.github.com/users/ycrumeyrolle/events{/privacy}","received_events_url":"https://api.github.com/users/ycrumeyrolle/received_events","type":"User","site_admin":false},"repo":{"id":31037429,"name":"Logging","full_name":"ycrumeyrolle/Logging","owner":{"login":"ycrumeyrolle","id":1958836,"avatar_url":"https://avatars.githubusercontent.com/u/1958836?v=3","gravatar_id":"","url":"https://api.github.com/users/ycrumeyrolle","html_url":"https://github.com/ycrumeyrolle","followers_url":"https://api.github.com/users/ycrumeyrolle/followers","following_url":"https://api.github.com/users/ycrumeyrolle/following{/other_user}","gists_url":"https://api.github.com/users/ycrumeyrolle/gists{/gist_id}","starred_url":"https://api.github.com/users/ycrumeyrolle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ycrumeyrolle/subscriptions","organizations_url":"https://api.github.com/users/ycrumeyrolle/orgs","repos_url":"https://api.github.com/users/ycrumeyrolle/repos","events_url":"https://api.github.com/users/ycrumeyrolle/events{/privacy}","received_events_url":"https://api.github.com/users/ycrumeyrolle/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ycrumeyrolle/Logging","description":"Common logging abstractions for ASP.NET vNext.","fork":true,"url":"https://api.github.com/repos/ycrumeyrolle/Logging","forks_url":"https://api.github.com/repos/ycrumeyrolle/Logging/forks","keys_url":"https://api.github.com/repos/ycrumeyrolle/Logging/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ycrumeyrolle/Logging/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ycrumeyrolle/Logging/teams","hooks_url":"https://api.github.com/repos/ycrumeyrolle/Logging/hooks","issue_events_url":"https://api.github.com/repos/ycrumeyrolle/Logging/issues/events{/number}","events_url":"https://api.github.com/repos/ycrumeyrolle/Logging/events","assignees_url":"https://api.github.com/repos/ycrumeyrolle/Logging/assignees{/user}","branches_url":"https://api.github.com/repos/ycrumeyrolle/Logging/branches{/branch}","tags_url":"https://api.github.com/repos/ycrumeyrolle/Logging/tags","blobs_url":"https://api.github.com/repos/ycrumeyrolle/Logging/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ycrumeyrolle/Logging/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ycrumeyrolle/Logging/git/refs{/sha}","trees_url":"https://api.github.com/repos/ycrumeyrolle/Logging/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ycrumeyrolle/Logging/statuses/{sha}","languages_url":"https://api.github.com/repos/ycrumeyrolle/Logging/languages","stargazers_url":"https://api.github.com/repos/ycrumeyrolle/Logging/stargazers","contributors_url":"https://api.github.com/repos/ycrumeyrolle/Logging/contributors","subscribers_url":"https://api.github.com/repos/ycrumeyrolle/Logging/subscribers","subscription_url":"https://api.github.com/repos/ycrumeyrolle/Logging/subscription","commits_url":"https://api.github.com/repos/ycrumeyrolle/Logging/commits{/sha}","git_commits_url":"https://api.github.com/repos/ycrumeyrolle/Logging/git/commits{/sha}","comments_url":"https://api.github.com/repos/ycrumeyrolle/Logging/comments{/number}","issue_comment_url":"https://api.github.com/repos/ycrumeyrolle/Logging/issues/comments{/number}","contents_url":"https://api.github.com/repos/ycrumeyrolle/Logging/contents/{+path}","compare_url":"https://api.github.com/repos/ycrumeyrolle/Logging/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ycrumeyrolle/Logging/merges","archive_url":"https://api.github.com/repos/ycrumeyrolle/Logging/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ycrumeyrolle/Logging/downloads","issues_url":"https://api.github.com/repos/ycrumeyrolle/Logging/issues{/number}","pulls_url":"https://api.github.com/repos/ycrumeyrolle/Logging/pulls{/number}","milestones_url":"https://api.github.com/repos/ycrumeyrolle/Logging/milestones{/number}","notifications_url":"https://api.github.com/repos/ycrumeyrolle/Logging/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ycrumeyrolle/Logging/labels{/name}","releases_url":"https://api.github.com/repos/ycrumeyrolle/Logging/releases{/id}","created_at":"2015-02-19T21:18:47Z","updated_at":"2015-04-01T20:17:00Z","pushed_at":"2015-07-08T20:05:24Z","git_url":"git://github.com/ycrumeyrolle/Logging.git","ssh_url":"git@github.com:ycrumeyrolle/Logging.git","clone_url":"https://github.com/ycrumeyrolle/Logging.git","svn_url":"https://github.com/ycrumeyrolle/Logging","homepage":"","size":404,"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":"dev"}},"base":{"label":"aspnet:dev","ref":"dev","sha":"623303a44d5d2b6e641e8d30652c140172a78e7c","user":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"repo":{"id":15836601,"name":"Logging","full_name":"aspnet/Logging","owner":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aspnet/Logging","description":"Common logging abstractions for DNX and ASP.NET 5.","fork":false,"url":"https://api.github.com/repos/aspnet/Logging","forks_url":"https://api.github.com/repos/aspnet/Logging/forks","keys_url":"https://api.github.com/repos/aspnet/Logging/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspnet/Logging/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspnet/Logging/teams","hooks_url":"https://api.github.com/repos/aspnet/Logging/hooks","issue_events_url":"https://api.github.com/repos/aspnet/Logging/issues/events{/number}","events_url":"https://api.github.com/repos/aspnet/Logging/events","assignees_url":"https://api.github.com/repos/aspnet/Logging/assignees{/user}","branches_url":"https://api.github.com/repos/aspnet/Logging/branches{/branch}","tags_url":"https://api.github.com/repos/aspnet/Logging/tags","blobs_url":"https://api.github.com/repos/aspnet/Logging/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspnet/Logging/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspnet/Logging/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspnet/Logging/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspnet/Logging/statuses/{sha}","languages_url":"https://api.github.com/repos/aspnet/Logging/languages","stargazers_url":"https://api.github.com/repos/aspnet/Logging/stargazers","contributors_url":"https://api.github.com/repos/aspnet/Logging/contributors","subscribers_url":"https://api.github.com/repos/aspnet/Logging/subscribers","subscription_url":"https://api.github.com/repos/aspnet/Logging/subscription","commits_url":"https://api.github.com/repos/aspnet/Logging/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspnet/Logging/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspnet/Logging/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspnet/Logging/issues/comments{/number}","contents_url":"https://api.github.com/repos/aspnet/Logging/contents/{+path}","compare_url":"https://api.github.com/repos/aspnet/Logging/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspnet/Logging/merges","archive_url":"https://api.github.com/repos/aspnet/Logging/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspnet/Logging/downloads","issues_url":"https://api.github.com/repos/aspnet/Logging/issues{/number}","pulls_url":"https://api.github.com/repos/aspnet/Logging/pulls{/number}","milestones_url":"https://api.github.com/repos/aspnet/Logging/milestones{/number}","notifications_url":"https://api.github.com/repos/aspnet/Logging/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspnet/Logging/labels{/name}","releases_url":"https://api.github.com/repos/aspnet/Logging/releases{/id}","created_at":"2014-01-12T04:46:28Z","updated_at":"2015-08-04T14:01:30Z","pushed_at":"2015-08-04T17:17:32Z","git_url":"git://github.com/aspnet/Logging.git","ssh_url":"git@github.com:aspnet/Logging.git","clone_url":"https://github.com/aspnet/Logging.git","svn_url":"https://github.com/aspnet/Logging","homepage":"","size":2572,"stargazers_count":133,"watchers_count":133,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":60,"mirror_url":null,"open_issues_count":29,"forks":60,"open_issues":29,"watchers":133,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/aspnet/Logging/pulls/162"},"html":{"href":"https://github.com/aspnet/Logging/pull/162"},"issue":{"href":"https://api.github.com/repos/aspnet/Logging/issues/162"},"comments":{"href":"https://api.github.com/repos/aspnet/Logging/issues/162/comments"},"review_comments":{"href":"https://api.github.com/repos/aspnet/Logging/pulls/162/comments"},"review_comment":{"href":"https://api.github.com/repos/aspnet/Logging/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aspnet/Logging/pulls/162/commits"},"statuses":{"href":"https://api.github.com/repos/aspnet/Logging/statuses/8dd38a0a8372605510b0a6f8ec7dbb475d71afc8"}}}}