{"action":"created","comment":{"url":"https://api.github.com/repos/HangfireIO/Hangfire/pulls/comments/36477254","id":36477254,"diff_hunk":"@@ -0,0 +1,37 @@\n+﻿// This file is part of Hangfire.\n+// Copyright © 2013-2014 Sergey Odinokov.\n+// \n+// Hangfire is free software: you can redistribute it and/or modify\n+// it under the terms of the GNU Lesser General Public License as \n+// published by the Free Software Foundation, either version 3 \n+// of the License, or any later version.\n+// \n+// Hangfire is distributed in the hope that it will be useful,\n+// but WITHOUT ANY WARRANTY; without even the implied warranty of\n+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+// GNU Lesser General Public License for more details.\n+// \n+// You should have received a copy of the GNU Lesser General Public \n+// License along with Hangfire. If not, see <http://www.gnu.org/licenses/>.\n+\n+namespace Hangfire\n+{\n+    public interface IJobExecutionContext : IJobCancellationToken\n+    {\n+        string JobId { get; }\n+\n+        /// <summary>\n+        /// Report the current status of a job, potentially to an end-user, along with an\n+        /// estimate of the % of the job that is completed.\n+        /// </summary>\n+        /// <param name=\"percentComplete\"></param>\n+        /// <param name=\"currentStatus\"></param>\n+        void UpdateProgress(int percentComplete, string currentStatus);\n+        \n+        void LogDebug(string message);","path":"src/Hangfire.Core/IJobExecutionContext.cs","position":31,"original_position":31,"commit_id":"1081b417ba8a603819151e79d3c3d4e99ac35aa4","original_commit_id":"ac5159546f4712b72ce58c40c46088328ba3c588","user":{"login":"nirinchev","id":2315687,"avatar_url":"https://avatars.githubusercontent.com/u/2315687?v=3","gravatar_id":"","url":"https://api.github.com/users/nirinchev","html_url":"https://github.com/nirinchev","followers_url":"https://api.github.com/users/nirinchev/followers","following_url":"https://api.github.com/users/nirinchev/following{/other_user}","gists_url":"https://api.github.com/users/nirinchev/gists{/gist_id}","starred_url":"https://api.github.com/users/nirinchev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nirinchev/subscriptions","organizations_url":"https://api.github.com/users/nirinchev/orgs","repos_url":"https://api.github.com/users/nirinchev/repos","events_url":"https://api.github.com/users/nirinchev/events{/privacy}","received_events_url":"https://api.github.com/users/nirinchev/received_events","type":"User","site_admin":false},"body":"I too think it's useful, but specifying it in the interface, forces every implementor to copy past much of the same implementation, which pollutes the contract. A better approach (in my opinion) would be to have only ```Log(Severity severity, string message)``` in the interface, and then implement the helper ```LogDebug```, ```LogInfo``` and so on as extension methods. This keeps the contract clean, while still preserving the useful helper methods.","created_at":"2015-08-06T23:13:24Z","updated_at":"2015-08-06T23:13:24Z","html_url":"https://github.com/HangfireIO/Hangfire/pull/232#discussion_r36477254","pull_request_url":"https://api.github.com/repos/HangfireIO/Hangfire/pulls/232","_links":{"self":{"href":"https://api.github.com/repos/HangfireIO/Hangfire/pulls/comments/36477254"},"html":{"href":"https://github.com/HangfireIO/Hangfire/pull/232#discussion_r36477254"},"pull_request":{"href":"https://api.github.com/repos/HangfireIO/Hangfire/pulls/232"}}},"pull_request":{"url":"https://api.github.com/repos/HangfireIO/Hangfire/pulls/232","id":23254643,"html_url":"https://github.com/HangfireIO/Hangfire/pull/232","diff_url":"https://github.com/HangfireIO/Hangfire/pull/232.diff","patch_url":"https://github.com/HangfireIO/Hangfire/pull/232.patch","issue_url":"https://api.github.com/repos/HangfireIO/Hangfire/issues/232","number":232,"state":"open","locked":false,"title":"Added logging support to Hangfire","user":{"login":"ses4j","id":435529,"avatar_url":"https://avatars.githubusercontent.com/u/435529?v=3","gravatar_id":"","url":"https://api.github.com/users/ses4j","html_url":"https://github.com/ses4j","followers_url":"https://api.github.com/users/ses4j/followers","following_url":"https://api.github.com/users/ses4j/following{/other_user}","gists_url":"https://api.github.com/users/ses4j/gists{/gist_id}","starred_url":"https://api.github.com/users/ses4j/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ses4j/subscriptions","organizations_url":"https://api.github.com/users/ses4j/orgs","repos_url":"https://api.github.com/users/ses4j/repos","events_url":"https://api.github.com/users/ses4j/events{/privacy}","received_events_url":"https://api.github.com/users/ses4j/received_events","type":"User","site_admin":false},"body":"Covers issues raised in issue #218, by augmenting the cancellation token with a more feature-ful JobExecutionContext (which inherits the cancellationtoken for backwards compatibility reasons).  \r\n\r\nJobExecutionContext offers an API for logging and accessing the Job Id.  Logs are written to the existing state table as \"PROCESSING\" messages.  Possibly, some table changes should be made to organize things a little cleaner, but I didn't know how to deal with migration issues, so I worked with the existing schema.\r\n\r\nThe dashboard displays logged messages as seen below.\r\n\r\n![capture](https://cloud.githubusercontent.com/assets/435529/4760281/a1aa4da0-5aee-11e4-8ec4-1edc33b63136.PNG)\r\n","created_at":"2014-10-23T19:56:31Z","updated_at":"2015-08-06T23:13:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f92344ebe63ec4d16cfcd75c6a0e82c96ea0d1ec","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/HangfireIO/Hangfire/pulls/232/commits","review_comments_url":"https://api.github.com/repos/HangfireIO/Hangfire/pulls/232/comments","review_comment_url":"https://api.github.com/repos/HangfireIO/Hangfire/pulls/comments{/number}","comments_url":"https://api.github.com/repos/HangfireIO/Hangfire/issues/232/comments","statuses_url":"https://api.github.com/repos/HangfireIO/Hangfire/statuses/1081b417ba8a603819151e79d3c3d4e99ac35aa4","head":{"label":"mppa-git:master","ref":"master","sha":"1081b417ba8a603819151e79d3c3d4e99ac35aa4","user":{"login":"mppa-git","id":3641261,"avatar_url":"https://avatars.githubusercontent.com/u/3641261?v=3","gravatar_id":"","url":"https://api.github.com/users/mppa-git","html_url":"https://github.com/mppa-git","followers_url":"https://api.github.com/users/mppa-git/followers","following_url":"https://api.github.com/users/mppa-git/following{/other_user}","gists_url":"https://api.github.com/users/mppa-git/gists{/gist_id}","starred_url":"https://api.github.com/users/mppa-git/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mppa-git/subscriptions","organizations_url":"https://api.github.com/users/mppa-git/orgs","repos_url":"https://api.github.com/users/mppa-git/repos","events_url":"https://api.github.com/users/mppa-git/events{/privacy}","received_events_url":"https://api.github.com/users/mppa-git/received_events","type":"Organization","site_admin":false},"repo":{"id":25005183,"name":"Hangfire","full_name":"mppa-git/Hangfire","owner":{"login":"mppa-git","id":3641261,"avatar_url":"https://avatars.githubusercontent.com/u/3641261?v=3","gravatar_id":"","url":"https://api.github.com/users/mppa-git","html_url":"https://github.com/mppa-git","followers_url":"https://api.github.com/users/mppa-git/followers","following_url":"https://api.github.com/users/mppa-git/following{/other_user}","gists_url":"https://api.github.com/users/mppa-git/gists{/gist_id}","starred_url":"https://api.github.com/users/mppa-git/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mppa-git/subscriptions","organizations_url":"https://api.github.com/users/mppa-git/orgs","repos_url":"https://api.github.com/users/mppa-git/repos","events_url":"https://api.github.com/users/mppa-git/events{/privacy}","received_events_url":"https://api.github.com/users/mppa-git/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mppa-git/Hangfire","description":"Incredibly easy way to perform fire-and-forget, delayed and recurring tasks inside ASP.NET applications","fork":true,"url":"https://api.github.com/repos/mppa-git/Hangfire","forks_url":"https://api.github.com/repos/mppa-git/Hangfire/forks","keys_url":"https://api.github.com/repos/mppa-git/Hangfire/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mppa-git/Hangfire/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mppa-git/Hangfire/teams","hooks_url":"https://api.github.com/repos/mppa-git/Hangfire/hooks","issue_events_url":"https://api.github.com/repos/mppa-git/Hangfire/issues/events{/number}","events_url":"https://api.github.com/repos/mppa-git/Hangfire/events","assignees_url":"https://api.github.com/repos/mppa-git/Hangfire/assignees{/user}","branches_url":"https://api.github.com/repos/mppa-git/Hangfire/branches{/branch}","tags_url":"https://api.github.com/repos/mppa-git/Hangfire/tags","blobs_url":"https://api.github.com/repos/mppa-git/Hangfire/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mppa-git/Hangfire/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mppa-git/Hangfire/git/refs{/sha}","trees_url":"https://api.github.com/repos/mppa-git/Hangfire/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mppa-git/Hangfire/statuses/{sha}","languages_url":"https://api.github.com/repos/mppa-git/Hangfire/languages","stargazers_url":"https://api.github.com/repos/mppa-git/Hangfire/stargazers","contributors_url":"https://api.github.com/repos/mppa-git/Hangfire/contributors","subscribers_url":"https://api.github.com/repos/mppa-git/Hangfire/subscribers","subscription_url":"https://api.github.com/repos/mppa-git/Hangfire/subscription","commits_url":"https://api.github.com/repos/mppa-git/Hangfire/commits{/sha}","git_commits_url":"https://api.github.com/repos/mppa-git/Hangfire/git/commits{/sha}","comments_url":"https://api.github.com/repos/mppa-git/Hangfire/comments{/number}","issue_comment_url":"https://api.github.com/repos/mppa-git/Hangfire/issues/comments{/number}","contents_url":"https://api.github.com/repos/mppa-git/Hangfire/contents/{+path}","compare_url":"https://api.github.com/repos/mppa-git/Hangfire/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mppa-git/Hangfire/merges","archive_url":"https://api.github.com/repos/mppa-git/Hangfire/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mppa-git/Hangfire/downloads","issues_url":"https://api.github.com/repos/mppa-git/Hangfire/issues{/number}","pulls_url":"https://api.github.com/repos/mppa-git/Hangfire/pulls{/number}","milestones_url":"https://api.github.com/repos/mppa-git/Hangfire/milestones{/number}","notifications_url":"https://api.github.com/repos/mppa-git/Hangfire/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mppa-git/Hangfire/labels{/name}","releases_url":"https://api.github.com/repos/mppa-git/Hangfire/releases{/id}","created_at":"2014-10-09T19:31:23Z","updated_at":"2014-10-16T21:09:02Z","pushed_at":"2015-08-06T20:38:36Z","git_url":"git://github.com/mppa-git/Hangfire.git","ssh_url":"git@github.com:mppa-git/Hangfire.git","clone_url":"https://github.com/mppa-git/Hangfire.git","svn_url":"https://github.com/mppa-git/Hangfire","homepage":"http://hangfire.io","size":22251,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"HangfireIO:master","ref":"master","sha":"5a770aab402b820f262f0872b18c2d3304bb7128","user":{"login":"HangfireIO","id":7880472,"avatar_url":"https://avatars.githubusercontent.com/u/7880472?v=3","gravatar_id":"","url":"https://api.github.com/users/HangfireIO","html_url":"https://github.com/HangfireIO","followers_url":"https://api.github.com/users/HangfireIO/followers","following_url":"https://api.github.com/users/HangfireIO/following{/other_user}","gists_url":"https://api.github.com/users/HangfireIO/gists{/gist_id}","starred_url":"https://api.github.com/users/HangfireIO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HangfireIO/subscriptions","organizations_url":"https://api.github.com/users/HangfireIO/orgs","repos_url":"https://api.github.com/users/HangfireIO/repos","events_url":"https://api.github.com/users/HangfireIO/events{/privacy}","received_events_url":"https://api.github.com/users/HangfireIO/received_events","type":"Organization","site_admin":false},"repo":{"id":11920542,"name":"Hangfire","full_name":"HangfireIO/Hangfire","owner":{"login":"HangfireIO","id":7880472,"avatar_url":"https://avatars.githubusercontent.com/u/7880472?v=3","gravatar_id":"","url":"https://api.github.com/users/HangfireIO","html_url":"https://github.com/HangfireIO","followers_url":"https://api.github.com/users/HangfireIO/followers","following_url":"https://api.github.com/users/HangfireIO/following{/other_user}","gists_url":"https://api.github.com/users/HangfireIO/gists{/gist_id}","starred_url":"https://api.github.com/users/HangfireIO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HangfireIO/subscriptions","organizations_url":"https://api.github.com/users/HangfireIO/orgs","repos_url":"https://api.github.com/users/HangfireIO/repos","events_url":"https://api.github.com/users/HangfireIO/events{/privacy}","received_events_url":"https://api.github.com/users/HangfireIO/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/HangfireIO/Hangfire","description":"An easy way to perform fire-and-forget, delayed and recurring tasks inside ASP.NET apps","fork":false,"url":"https://api.github.com/repos/HangfireIO/Hangfire","forks_url":"https://api.github.com/repos/HangfireIO/Hangfire/forks","keys_url":"https://api.github.com/repos/HangfireIO/Hangfire/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HangfireIO/Hangfire/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HangfireIO/Hangfire/teams","hooks_url":"https://api.github.com/repos/HangfireIO/Hangfire/hooks","issue_events_url":"https://api.github.com/repos/HangfireIO/Hangfire/issues/events{/number}","events_url":"https://api.github.com/repos/HangfireIO/Hangfire/events","assignees_url":"https://api.github.com/repos/HangfireIO/Hangfire/assignees{/user}","branches_url":"https://api.github.com/repos/HangfireIO/Hangfire/branches{/branch}","tags_url":"https://api.github.com/repos/HangfireIO/Hangfire/tags","blobs_url":"https://api.github.com/repos/HangfireIO/Hangfire/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HangfireIO/Hangfire/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HangfireIO/Hangfire/git/refs{/sha}","trees_url":"https://api.github.com/repos/HangfireIO/Hangfire/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HangfireIO/Hangfire/statuses/{sha}","languages_url":"https://api.github.com/repos/HangfireIO/Hangfire/languages","stargazers_url":"https://api.github.com/repos/HangfireIO/Hangfire/stargazers","contributors_url":"https://api.github.com/repos/HangfireIO/Hangfire/contributors","subscribers_url":"https://api.github.com/repos/HangfireIO/Hangfire/subscribers","subscription_url":"https://api.github.com/repos/HangfireIO/Hangfire/subscription","commits_url":"https://api.github.com/repos/HangfireIO/Hangfire/commits{/sha}","git_commits_url":"https://api.github.com/repos/HangfireIO/Hangfire/git/commits{/sha}","comments_url":"https://api.github.com/repos/HangfireIO/Hangfire/comments{/number}","issue_comment_url":"https://api.github.com/repos/HangfireIO/Hangfire/issues/comments{/number}","contents_url":"https://api.github.com/repos/HangfireIO/Hangfire/contents/{+path}","compare_url":"https://api.github.com/repos/HangfireIO/Hangfire/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HangfireIO/Hangfire/merges","archive_url":"https://api.github.com/repos/HangfireIO/Hangfire/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HangfireIO/Hangfire/downloads","issues_url":"https://api.github.com/repos/HangfireIO/Hangfire/issues{/number}","pulls_url":"https://api.github.com/repos/HangfireIO/Hangfire/pulls{/number}","milestones_url":"https://api.github.com/repos/HangfireIO/Hangfire/milestones{/number}","notifications_url":"https://api.github.com/repos/HangfireIO/Hangfire/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HangfireIO/Hangfire/labels{/name}","releases_url":"https://api.github.com/repos/HangfireIO/Hangfire/releases{/id}","created_at":"2013-08-06T09:43:04Z","updated_at":"2015-08-06T22:48:11Z","pushed_at":"2015-08-06T20:38:37Z","git_url":"git://github.com/HangfireIO/Hangfire.git","ssh_url":"git@github.com:HangfireIO/Hangfire.git","clone_url":"https://github.com/HangfireIO/Hangfire.git","svn_url":"https://github.com/HangfireIO/Hangfire","homepage":"http://hangfire.io","size":29387,"stargazers_count":1040,"watchers_count":1040,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":266,"mirror_url":null,"open_issues_count":69,"forks":266,"open_issues":69,"watchers":1040,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/HangfireIO/Hangfire/pulls/232"},"html":{"href":"https://github.com/HangfireIO/Hangfire/pull/232"},"issue":{"href":"https://api.github.com/repos/HangfireIO/Hangfire/issues/232"},"comments":{"href":"https://api.github.com/repos/HangfireIO/Hangfire/issues/232/comments"},"review_comments":{"href":"https://api.github.com/repos/HangfireIO/Hangfire/pulls/232/comments"},"review_comment":{"href":"https://api.github.com/repos/HangfireIO/Hangfire/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/HangfireIO/Hangfire/pulls/232/commits"},"statuses":{"href":"https://api.github.com/repos/HangfireIO/Hangfire/statuses/1081b417ba8a603819151e79d3c3d4e99ac35aa4"}}}}