{"action":"created","comment":{"url":"https://api.github.com/repos/aspnet/Logging/pulls/comments/94250304","pull_request_review_id":14781493,"id":94250304,"diff_hunk":"@@ -2,21 +2,26 @@\n // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\n \n using System;\n+using System.Collections.Concurrent;\n+using System.Reflection;\n using System.Runtime.InteropServices;\n using System.Text;\n+using System.Threading;\n+using System.Threading.Tasks;\n using Microsoft.Extensions.Logging.Console.Internal;\n \n namespace Microsoft.Extensions.Logging.Console\n {\n     public class ConsoleLogger : ILogger\n     {\n-        // Writing to console is not an atomic operation in the current implementation and since multiple logger\n-        // instances are created with a different name. Also since Console is global, using a static lock is fine.\n-        private static readonly object _lock = new object();\n         private static readonly string _loglevelPadding = \": \";\n         private static readonly string _messagePadding;\n         private static readonly string _newLineWithMessagePadding;\n \n+        private readonly SemaphoreSlim _semaphore = new SemaphoreSlim(0);\n+        private readonly ConcurrentQueue<LogMessageEntry> _messageQueue = new ConcurrentQueue<LogMessageEntry>();","path":"src/Microsoft.Extensions.Logging.Console/ConsoleLogger.cs","position":24,"original_position":24,"commit_id":"32288a825c7c93a932153e75e32b1a57d5e65f6d","original_commit_id":"32288a825c7c93a932153e75e32b1a57d5e65f6d","user":{"login":"benaadams","id":1142958,"avatar_url":"https://avatars.githubusercontent.com/u/1142958?v=3","gravatar_id":"","url":"https://api.github.com/users/benaadams","html_url":"https://github.com/benaadams","followers_url":"https://api.github.com/users/benaadams/followers","following_url":"https://api.github.com/users/benaadams/following{/other_user}","gists_url":"https://api.github.com/users/benaadams/gists{/gist_id}","starred_url":"https://api.github.com/users/benaadams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benaadams/subscriptions","organizations_url":"https://api.github.com/users/benaadams/orgs","repos_url":"https://api.github.com/users/benaadams/repos","events_url":"https://api.github.com/users/benaadams/events{/privacy}","received_events_url":"https://api.github.com/users/benaadams/received_events","type":"User","site_admin":false},"body":"You thinking for upper bounds? Would have to spin up a dedicated thread to use it as its sync blocking.","created_at":"2016-12-30T18:59:01Z","updated_at":"2016-12-30T18:59:01Z","html_url":"https://github.com/aspnet/Logging/pull/536#discussion_r94250304","pull_request_url":"https://api.github.com/repos/aspnet/Logging/pulls/536","_links":{"self":{"href":"https://api.github.com/repos/aspnet/Logging/pulls/comments/94250304"},"html":{"href":"https://github.com/aspnet/Logging/pull/536#discussion_r94250304"},"pull_request":{"href":"https://api.github.com/repos/aspnet/Logging/pulls/536"}}},"pull_request":{"url":"https://api.github.com/repos/aspnet/Logging/pulls/536","id":99757721,"html_url":"https://github.com/aspnet/Logging/pull/536","diff_url":"https://github.com/aspnet/Logging/pull/536.diff","patch_url":"https://github.com/aspnet/Logging/pull/536.patch","issue_url":"https://api.github.com/repos/aspnet/Logging/issues/536","number":536,"state":"open","locked":false,"title":"Move Console.Write out of critial path","user":{"login":"benaadams","id":1142958,"avatar_url":"https://avatars.githubusercontent.com/u/1142958?v=3","gravatar_id":"","url":"https://api.github.com/users/benaadams","html_url":"https://github.com/benaadams","followers_url":"https://api.github.com/users/benaadams/followers","following_url":"https://api.github.com/users/benaadams/following{/other_user}","gists_url":"https://api.github.com/users/benaadams/gists{/gist_id}","starred_url":"https://api.github.com/users/benaadams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benaadams/subscriptions","organizations_url":"https://api.github.com/users/benaadams/orgs","repos_url":"https://api.github.com/users/benaadams/repos","events_url":"https://api.github.com/users/benaadams/events{/privacy}","received_events_url":"https://api.github.com/users/benaadams/received_events","type":"User","site_admin":false},"body":"Resolves https://github.com/aspnet/Logging/issues/532","created_at":"2016-12-30T14:55:30Z","updated_at":"2016-12-30T18:59:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0908a03c85d5758491ee0f3d0192be6891a9ad98","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/aspnet/Logging/pulls/536/commits","review_comments_url":"https://api.github.com/repos/aspnet/Logging/pulls/536/comments","review_comment_url":"https://api.github.com/repos/aspnet/Logging/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aspnet/Logging/issues/536/comments","statuses_url":"https://api.github.com/repos/aspnet/Logging/statuses/32288a825c7c93a932153e75e32b1a57d5e65f6d","head":{"label":"benaadams:console-queue","ref":"console-queue","sha":"32288a825c7c93a932153e75e32b1a57d5e65f6d","user":{"login":"benaadams","id":1142958,"avatar_url":"https://avatars.githubusercontent.com/u/1142958?v=3","gravatar_id":"","url":"https://api.github.com/users/benaadams","html_url":"https://github.com/benaadams","followers_url":"https://api.github.com/users/benaadams/followers","following_url":"https://api.github.com/users/benaadams/following{/other_user}","gists_url":"https://api.github.com/users/benaadams/gists{/gist_id}","starred_url":"https://api.github.com/users/benaadams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benaadams/subscriptions","organizations_url":"https://api.github.com/users/benaadams/orgs","repos_url":"https://api.github.com/users/benaadams/repos","events_url":"https://api.github.com/users/benaadams/events{/privacy}","received_events_url":"https://api.github.com/users/benaadams/received_events","type":"User","site_admin":false},"repo":{"id":42715344,"name":"Logging","full_name":"benaadams/Logging","owner":{"login":"benaadams","id":1142958,"avatar_url":"https://avatars.githubusercontent.com/u/1142958?v=3","gravatar_id":"","url":"https://api.github.com/users/benaadams","html_url":"https://github.com/benaadams","followers_url":"https://api.github.com/users/benaadams/followers","following_url":"https://api.github.com/users/benaadams/following{/other_user}","gists_url":"https://api.github.com/users/benaadams/gists{/gist_id}","starred_url":"https://api.github.com/users/benaadams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benaadams/subscriptions","organizations_url":"https://api.github.com/users/benaadams/orgs","repos_url":"https://api.github.com/users/benaadams/repos","events_url":"https://api.github.com/users/benaadams/events{/privacy}","received_events_url":"https://api.github.com/users/benaadams/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/benaadams/Logging","description":"Common logging abstractions for DNX and ASP.NET 5.","fork":true,"url":"https://api.github.com/repos/benaadams/Logging","forks_url":"https://api.github.com/repos/benaadams/Logging/forks","keys_url":"https://api.github.com/repos/benaadams/Logging/keys{/key_id}","collaborators_url":"https://api.github.com/repos/benaadams/Logging/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/benaadams/Logging/teams","hooks_url":"https://api.github.com/repos/benaadams/Logging/hooks","issue_events_url":"https://api.github.com/repos/benaadams/Logging/issues/events{/number}","events_url":"https://api.github.com/repos/benaadams/Logging/events","assignees_url":"https://api.github.com/repos/benaadams/Logging/assignees{/user}","branches_url":"https://api.github.com/repos/benaadams/Logging/branches{/branch}","tags_url":"https://api.github.com/repos/benaadams/Logging/tags","blobs_url":"https://api.github.com/repos/benaadams/Logging/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/benaadams/Logging/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/benaadams/Logging/git/refs{/sha}","trees_url":"https://api.github.com/repos/benaadams/Logging/git/trees{/sha}","statuses_url":"https://api.github.com/repos/benaadams/Logging/statuses/{sha}","languages_url":"https://api.github.com/repos/benaadams/Logging/languages","stargazers_url":"https://api.github.com/repos/benaadams/Logging/stargazers","contributors_url":"https://api.github.com/repos/benaadams/Logging/contributors","subscribers_url":"https://api.github.com/repos/benaadams/Logging/subscribers","subscription_url":"https://api.github.com/repos/benaadams/Logging/subscription","commits_url":"https://api.github.com/repos/benaadams/Logging/commits{/sha}","git_commits_url":"https://api.github.com/repos/benaadams/Logging/git/commits{/sha}","comments_url":"https://api.github.com/repos/benaadams/Logging/comments{/number}","issue_comment_url":"https://api.github.com/repos/benaadams/Logging/issues/comments{/number}","contents_url":"https://api.github.com/repos/benaadams/Logging/contents/{+path}","compare_url":"https://api.github.com/repos/benaadams/Logging/compare/{base}...{head}","merges_url":"https://api.github.com/repos/benaadams/Logging/merges","archive_url":"https://api.github.com/repos/benaadams/Logging/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/benaadams/Logging/downloads","issues_url":"https://api.github.com/repos/benaadams/Logging/issues{/number}","pulls_url":"https://api.github.com/repos/benaadams/Logging/pulls{/number}","milestones_url":"https://api.github.com/repos/benaadams/Logging/milestones{/number}","notifications_url":"https://api.github.com/repos/benaadams/Logging/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/benaadams/Logging/labels{/name}","releases_url":"https://api.github.com/repos/benaadams/Logging/releases{/id}","deployments_url":"https://api.github.com/repos/benaadams/Logging/deployments","created_at":"2015-09-18T10:32:21Z","updated_at":"2016-12-30T12:50:15Z","pushed_at":"2016-12-30T18:14:57Z","git_url":"git://github.com/benaadams/Logging.git","ssh_url":"git@github.com:benaadams/Logging.git","clone_url":"https://github.com/benaadams/Logging.git","svn_url":"https://github.com/benaadams/Logging","homepage":"","size":839,"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":"89e1d79a462faa3082f5d42c88035a97810b505f","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 and a few implementations","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}","deployments_url":"https://api.github.com/repos/aspnet/Logging/deployments","created_at":"2014-01-12T04:46:28Z","updated_at":"2016-12-28T07:34:53Z","pushed_at":"2016-12-30T18:14:58Z","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":922,"stargazers_count":289,"watchers_count":289,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":161,"mirror_url":null,"open_issues_count":82,"forks":161,"open_issues":82,"watchers":289,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/aspnet/Logging/pulls/536"},"html":{"href":"https://github.com/aspnet/Logging/pull/536"},"issue":{"href":"https://api.github.com/repos/aspnet/Logging/issues/536"},"comments":{"href":"https://api.github.com/repos/aspnet/Logging/issues/536/comments"},"review_comments":{"href":"https://api.github.com/repos/aspnet/Logging/pulls/536/comments"},"review_comment":{"href":"https://api.github.com/repos/aspnet/Logging/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aspnet/Logging/pulls/536/commits"},"statuses":{"href":"https://api.github.com/repos/aspnet/Logging/statuses/32288a825c7c93a932153e75e32b1a57d5e65f6d"}}}}
{"actor":{"display_login":"benaadams"}}