{"action":"created","comment":{"url":"https://api.github.com/repos/NLog/NLog/pulls/comments/32373600","id":32373600,"diff_hunk":"@@ -57,22 +57,42 @@ public static void Set(string item, string value)\n         }\n \n         /// <summary>\n+        /// Sets the Global Diagnostics Context item to the specified value.\n+        /// </summary>\n+        /// <param name=\"item\">Item name.</param>\n+        /// <param name=\"value\">Item value.</param>\n+        public static void Set(string item, object value)\n+        {\n+            lock (dict)\n+            {\n+                dict[item] = value;\n+            }\n+        }\n+\n+        /// <summary>\n         /// Gets the Global Diagnostics Context named item.\n         /// </summary>\n         /// <param name=\"item\">Item name.</param>\n         /// <returns>The item value of string.Empty if the value is not present.</returns>\n         public static string Get(string item)\n         {\n+            return RenderContextObject(GetObject(item));","path":"src/NLog/GlobalDiagnosticsContext.cs","position":32,"original_position":32,"commit_id":"374cef13f8180c7c318363fa3b9217931e914d61","original_commit_id":"374cef13f8180c7c318363fa3b9217931e914d61","user":{"login":"williamb1024","id":10245359,"avatar_url":"https://avatars.githubusercontent.com/u/10245359?v=3","gravatar_id":"","url":"https://api.github.com/users/williamb1024","html_url":"https://github.com/williamb1024","followers_url":"https://api.github.com/users/williamb1024/followers","following_url":"https://api.github.com/users/williamb1024/following{/other_user}","gists_url":"https://api.github.com/users/williamb1024/gists{/gist_id}","starred_url":"https://api.github.com/users/williamb1024/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/williamb1024/subscriptions","organizations_url":"https://api.github.com/users/williamb1024/orgs","repos_url":"https://api.github.com/users/williamb1024/repos","events_url":"https://api.github.com/users/williamb1024/events{/privacy}","received_events_url":"https://api.github.com/users/williamb1024/received_events","type":"User","site_admin":false},"body":"No, a `null` value will always return `String.Empty`. `String.Format` returns an empty string for \"{0}\" if the format argument is `null`.\r\n\r\nI wasn't sure initially, so I tested it before writing the code this way.","created_at":"2015-06-13T20:35:31Z","updated_at":"2015-06-13T20:35:31Z","html_url":"https://github.com/NLog/NLog/pull/743#discussion_r32373600","pull_request_url":"https://api.github.com/repos/NLog/NLog/pulls/743","_links":{"self":{"href":"https://api.github.com/repos/NLog/NLog/pulls/comments/32373600"},"html":{"href":"https://github.com/NLog/NLog/pull/743#discussion_r32373600"},"pull_request":{"href":"https://api.github.com/repos/NLog/NLog/pulls/743"}}},"pull_request":{"url":"https://api.github.com/repos/NLog/NLog/pulls/743","id":37424446,"html_url":"https://github.com/NLog/NLog/pull/743","diff_url":"https://github.com/NLog/NLog/pull/743.diff","patch_url":"https://github.com/NLog/NLog/pull/743.patch","issue_url":"https://api.github.com/repos/NLog/NLog/issues/743","number":743,"state":"open","locked":false,"title":"Support object values for GDC, MDC and NDC contexts.","user":{"login":"williamb1024","id":10245359,"avatar_url":"https://avatars.githubusercontent.com/u/10245359?v=3","gravatar_id":"","url":"https://api.github.com/users/williamb1024","html_url":"https://github.com/williamb1024","followers_url":"https://api.github.com/users/williamb1024/followers","following_url":"https://api.github.com/users/williamb1024/following{/other_user}","gists_url":"https://api.github.com/users/williamb1024/gists{/gist_id}","starred_url":"https://api.github.com/users/williamb1024/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/williamb1024/subscriptions","organizations_url":"https://api.github.com/users/williamb1024/orgs","repos_url":"https://api.github.com/users/williamb1024/repos","events_url":"https://api.github.com/users/williamb1024/events{/privacy}","received_events_url":"https://api.github.com/users/williamb1024/received_events","type":"User","site_admin":false},"body":"Add support for `object` values to GlobalDiagnosticsContext, MappedDiagnosticsContext and NestedDiagnosticsContext. \r\n\r\nIntroduces `GetObject` methods for GlobalDiagnosticsContext and MappedDiagnosticsContext. The method operates in the same manner as `Get` but returns an `object` type. The existing `Get` methods have been replaced to render any object values using `ToString()`.\r\n\r\nIntroduces `TopObject` and `PopObject` methods to NestedDiagnosticsContext. These methods operate the same as `TopMessage` and `Pop`, but return `object` values rather than string values. The `TopMessage` and `Pop` methods have been replaced to use `ToString()` to convert `object` values before return.\r\n\r\nThe associated layout renderers have also been modified to properly format object values to strings before rendering context properties.\r\n\r\nResolution for #738 \r\n\r\n","created_at":"2015-06-11T02:42:17Z","updated_at":"2015-06-13T20:35:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3968799b9d407c801fd2d475c2c1cb5079a4fd8e","assignee":{"login":"304NotModified","id":5808377,"avatar_url":"https://avatars.githubusercontent.com/u/5808377?v=3","gravatar_id":"","url":"https://api.github.com/users/304NotModified","html_url":"https://github.com/304NotModified","followers_url":"https://api.github.com/users/304NotModified/followers","following_url":"https://api.github.com/users/304NotModified/following{/other_user}","gists_url":"https://api.github.com/users/304NotModified/gists{/gist_id}","starred_url":"https://api.github.com/users/304NotModified/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/304NotModified/subscriptions","organizations_url":"https://api.github.com/users/304NotModified/orgs","repos_url":"https://api.github.com/users/304NotModified/repos","events_url":"https://api.github.com/users/304NotModified/events{/privacy}","received_events_url":"https://api.github.com/users/304NotModified/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/NLog/NLog/milestones/9","html_url":"https://github.com/NLog/NLog/milestones/4.1","labels_url":"https://api.github.com/repos/NLog/NLog/milestones/9/labels","id":1110760,"number":9,"title":"4.1","description":"Issues TBA","creator":{"login":"304NotModified","id":5808377,"avatar_url":"https://avatars.githubusercontent.com/u/5808377?v=3","gravatar_id":"","url":"https://api.github.com/users/304NotModified","html_url":"https://github.com/304NotModified","followers_url":"https://api.github.com/users/304NotModified/followers","following_url":"https://api.github.com/users/304NotModified/following{/other_user}","gists_url":"https://api.github.com/users/304NotModified/gists{/gist_id}","starred_url":"https://api.github.com/users/304NotModified/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/304NotModified/subscriptions","organizations_url":"https://api.github.com/users/304NotModified/orgs","repos_url":"https://api.github.com/users/304NotModified/repos","events_url":"https://api.github.com/users/304NotModified/events{/privacy}","received_events_url":"https://api.github.com/users/304NotModified/received_events","type":"User","site_admin":false},"open_issues":26,"closed_issues":0,"state":"open","created_at":"2015-05-14T19:20:27Z","updated_at":"2015-06-13T20:14:12Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/NLog/NLog/pulls/743/commits","review_comments_url":"https://api.github.com/repos/NLog/NLog/pulls/743/comments","review_comment_url":"https://api.github.com/repos/NLog/NLog/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NLog/NLog/issues/743/comments","statuses_url":"https://api.github.com/repos/NLog/NLog/statuses/374cef13f8180c7c318363fa3b9217931e914d61","head":{"label":"williamb1024:gdc-object","ref":"gdc-object","sha":"374cef13f8180c7c318363fa3b9217931e914d61","user":{"login":"williamb1024","id":10245359,"avatar_url":"https://avatars.githubusercontent.com/u/10245359?v=3","gravatar_id":"","url":"https://api.github.com/users/williamb1024","html_url":"https://github.com/williamb1024","followers_url":"https://api.github.com/users/williamb1024/followers","following_url":"https://api.github.com/users/williamb1024/following{/other_user}","gists_url":"https://api.github.com/users/williamb1024/gists{/gist_id}","starred_url":"https://api.github.com/users/williamb1024/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/williamb1024/subscriptions","organizations_url":"https://api.github.com/users/williamb1024/orgs","repos_url":"https://api.github.com/users/williamb1024/repos","events_url":"https://api.github.com/users/williamb1024/events{/privacy}","received_events_url":"https://api.github.com/users/williamb1024/received_events","type":"User","site_admin":false},"repo":{"id":37234177,"name":"NLog","full_name":"williamb1024/NLog","owner":{"login":"williamb1024","id":10245359,"avatar_url":"https://avatars.githubusercontent.com/u/10245359?v=3","gravatar_id":"","url":"https://api.github.com/users/williamb1024","html_url":"https://github.com/williamb1024","followers_url":"https://api.github.com/users/williamb1024/followers","following_url":"https://api.github.com/users/williamb1024/following{/other_user}","gists_url":"https://api.github.com/users/williamb1024/gists{/gist_id}","starred_url":"https://api.github.com/users/williamb1024/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/williamb1024/subscriptions","organizations_url":"https://api.github.com/users/williamb1024/orgs","repos_url":"https://api.github.com/users/williamb1024/repos","events_url":"https://api.github.com/users/williamb1024/events{/privacy}","received_events_url":"https://api.github.com/users/williamb1024/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/williamb1024/NLog","description":"NLog - Advanced .NET and Silverlight Logging","fork":true,"url":"https://api.github.com/repos/williamb1024/NLog","forks_url":"https://api.github.com/repos/williamb1024/NLog/forks","keys_url":"https://api.github.com/repos/williamb1024/NLog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/williamb1024/NLog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/williamb1024/NLog/teams","hooks_url":"https://api.github.com/repos/williamb1024/NLog/hooks","issue_events_url":"https://api.github.com/repos/williamb1024/NLog/issues/events{/number}","events_url":"https://api.github.com/repos/williamb1024/NLog/events","assignees_url":"https://api.github.com/repos/williamb1024/NLog/assignees{/user}","branches_url":"https://api.github.com/repos/williamb1024/NLog/branches{/branch}","tags_url":"https://api.github.com/repos/williamb1024/NLog/tags","blobs_url":"https://api.github.com/repos/williamb1024/NLog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/williamb1024/NLog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/williamb1024/NLog/git/refs{/sha}","trees_url":"https://api.github.com/repos/williamb1024/NLog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/williamb1024/NLog/statuses/{sha}","languages_url":"https://api.github.com/repos/williamb1024/NLog/languages","stargazers_url":"https://api.github.com/repos/williamb1024/NLog/stargazers","contributors_url":"https://api.github.com/repos/williamb1024/NLog/contributors","subscribers_url":"https://api.github.com/repos/williamb1024/NLog/subscribers","subscription_url":"https://api.github.com/repos/williamb1024/NLog/subscription","commits_url":"https://api.github.com/repos/williamb1024/NLog/commits{/sha}","git_commits_url":"https://api.github.com/repos/williamb1024/NLog/git/commits{/sha}","comments_url":"https://api.github.com/repos/williamb1024/NLog/comments{/number}","issue_comment_url":"https://api.github.com/repos/williamb1024/NLog/issues/comments{/number}","contents_url":"https://api.github.com/repos/williamb1024/NLog/contents/{+path}","compare_url":"https://api.github.com/repos/williamb1024/NLog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/williamb1024/NLog/merges","archive_url":"https://api.github.com/repos/williamb1024/NLog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/williamb1024/NLog/downloads","issues_url":"https://api.github.com/repos/williamb1024/NLog/issues{/number}","pulls_url":"https://api.github.com/repos/williamb1024/NLog/pulls{/number}","milestones_url":"https://api.github.com/repos/williamb1024/NLog/milestones{/number}","notifications_url":"https://api.github.com/repos/williamb1024/NLog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/williamb1024/NLog/labels{/name}","releases_url":"https://api.github.com/repos/williamb1024/NLog/releases{/id}","created_at":"2015-06-11T02:16:49Z","updated_at":"2015-06-11T02:16:52Z","pushed_at":"2015-06-13T19:01:15Z","git_url":"git://github.com/williamb1024/NLog.git","ssh_url":"git@github.com:williamb1024/NLog.git","clone_url":"https://github.com/williamb1024/NLog.git","svn_url":"https://github.com/williamb1024/NLog","homepage":null,"size":46729,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"NLog:master","ref":"master","sha":"79ead9ffc6e4e08d7a0fa5c96d9fa7761ee4356f","user":{"login":"NLog","id":2331628,"avatar_url":"https://avatars.githubusercontent.com/u/2331628?v=3","gravatar_id":"","url":"https://api.github.com/users/NLog","html_url":"https://github.com/NLog","followers_url":"https://api.github.com/users/NLog/followers","following_url":"https://api.github.com/users/NLog/following{/other_user}","gists_url":"https://api.github.com/users/NLog/gists{/gist_id}","starred_url":"https://api.github.com/users/NLog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NLog/subscriptions","organizations_url":"https://api.github.com/users/NLog/orgs","repos_url":"https://api.github.com/users/NLog/repos","events_url":"https://api.github.com/users/NLog/events{/privacy}","received_events_url":"https://api.github.com/users/NLog/received_events","type":"Organization","site_admin":false},"repo":{"id":5780416,"name":"NLog","full_name":"NLog/NLog","owner":{"login":"NLog","id":2331628,"avatar_url":"https://avatars.githubusercontent.com/u/2331628?v=3","gravatar_id":"","url":"https://api.github.com/users/NLog","html_url":"https://github.com/NLog","followers_url":"https://api.github.com/users/NLog/followers","following_url":"https://api.github.com/users/NLog/following{/other_user}","gists_url":"https://api.github.com/users/NLog/gists{/gist_id}","starred_url":"https://api.github.com/users/NLog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NLog/subscriptions","organizations_url":"https://api.github.com/users/NLog/orgs","repos_url":"https://api.github.com/users/NLog/repos","events_url":"https://api.github.com/users/NLog/events{/privacy}","received_events_url":"https://api.github.com/users/NLog/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NLog/NLog","description":"NLog - Advanced .NET and Silverlight Logging","fork":false,"url":"https://api.github.com/repos/NLog/NLog","forks_url":"https://api.github.com/repos/NLog/NLog/forks","keys_url":"https://api.github.com/repos/NLog/NLog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NLog/NLog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NLog/NLog/teams","hooks_url":"https://api.github.com/repos/NLog/NLog/hooks","issue_events_url":"https://api.github.com/repos/NLog/NLog/issues/events{/number}","events_url":"https://api.github.com/repos/NLog/NLog/events","assignees_url":"https://api.github.com/repos/NLog/NLog/assignees{/user}","branches_url":"https://api.github.com/repos/NLog/NLog/branches{/branch}","tags_url":"https://api.github.com/repos/NLog/NLog/tags","blobs_url":"https://api.github.com/repos/NLog/NLog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NLog/NLog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NLog/NLog/git/refs{/sha}","trees_url":"https://api.github.com/repos/NLog/NLog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NLog/NLog/statuses/{sha}","languages_url":"https://api.github.com/repos/NLog/NLog/languages","stargazers_url":"https://api.github.com/repos/NLog/NLog/stargazers","contributors_url":"https://api.github.com/repos/NLog/NLog/contributors","subscribers_url":"https://api.github.com/repos/NLog/NLog/subscribers","subscription_url":"https://api.github.com/repos/NLog/NLog/subscription","commits_url":"https://api.github.com/repos/NLog/NLog/commits{/sha}","git_commits_url":"https://api.github.com/repos/NLog/NLog/git/commits{/sha}","comments_url":"https://api.github.com/repos/NLog/NLog/comments{/number}","issue_comment_url":"https://api.github.com/repos/NLog/NLog/issues/comments{/number}","contents_url":"https://api.github.com/repos/NLog/NLog/contents/{+path}","compare_url":"https://api.github.com/repos/NLog/NLog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NLog/NLog/merges","archive_url":"https://api.github.com/repos/NLog/NLog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NLog/NLog/downloads","issues_url":"https://api.github.com/repos/NLog/NLog/issues{/number}","pulls_url":"https://api.github.com/repos/NLog/NLog/pulls{/number}","milestones_url":"https://api.github.com/repos/NLog/NLog/milestones{/number}","notifications_url":"https://api.github.com/repos/NLog/NLog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NLog/NLog/labels{/name}","releases_url":"https://api.github.com/repos/NLog/NLog/releases{/id}","created_at":"2012-09-12T13:49:29Z","updated_at":"2015-06-13T14:38:30Z","pushed_at":"2015-06-13T19:08:53Z","git_url":"git://github.com/NLog/NLog.git","ssh_url":"git@github.com:NLog/NLog.git","clone_url":"https://github.com/NLog/NLog.git","svn_url":"https://github.com/NLog/NLog","homepage":null,"size":57220,"stargazers_count":1013,"watchers_count":1013,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":377,"mirror_url":null,"open_issues_count":91,"forks":377,"open_issues":91,"watchers":1013,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/NLog/NLog/pulls/743"},"html":{"href":"https://github.com/NLog/NLog/pull/743"},"issue":{"href":"https://api.github.com/repos/NLog/NLog/issues/743"},"comments":{"href":"https://api.github.com/repos/NLog/NLog/issues/743/comments"},"review_comments":{"href":"https://api.github.com/repos/NLog/NLog/pulls/743/comments"},"review_comment":{"href":"https://api.github.com/repos/NLog/NLog/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NLog/NLog/pulls/743/commits"},"statuses":{"href":"https://api.github.com/repos/NLog/NLog/statuses/374cef13f8180c7c318363fa3b9217931e914d61"}}}}