{"action":"created","comment":{"url":"https://api.github.com/repos/DataMedSci/mcpartools/pulls/comments/135727414","pull_request_review_id":59169069,"id":135727414,"diff_hunk":"@@ -16,17 +15,17 @@ def __init__(self):\n \n     @classmethod\n     def get_scheduler(cls, scheduler_options, log_location):\n-        with open(os.path.join(log_location, \"generatemc.log\"), 'w+') as LOG_FILE:\n-            try:\n-                check_call(['srun --version'], stdout=LOG_FILE, stderr=LOG_FILE, shell=True)\n-                logger.debug(\"Discovered job scheduler SLURM\")\n-                return Slurm(scheduler_options)\n-            except CalledProcessError as e:\n-                logger.debug(\"Slurm not found: %s\", e)\n-            try:\n-                check_call(['qsub --version'], stdout=LOG_FILE, stderr=LOG_FILE, shell=True)\n-                logger.debug(\"Discovered job scheduler Torque\")\n-                return Torque(scheduler_options)\n-            except CalledProcessError as e:\n-                logger.debug(\"Torque not found: %s\", e)\n+        file_logger = logging.getLogger('file_logger')\n+        try:\n+            file_logger.info(check_output(['srun --version'], shell=True))","path":"mcpartools/scheduler/common.py","position":27,"original_position":27,"commit_id":"11c3a808e8b821b5e497aefb840f327a14ea28d8","original_commit_id":"11c3a808e8b821b5e497aefb840f327a14ea28d8","user":{"login":"grzanka","id":7374733,"avatar_url":"https://avatars0.githubusercontent.com/u/7374733?v=4","gravatar_id":"","url":"https://api.github.com/users/grzanka","html_url":"https://github.com/grzanka","followers_url":"https://api.github.com/users/grzanka/followers","following_url":"https://api.github.com/users/grzanka/following{/other_user}","gists_url":"https://api.github.com/users/grzanka/gists{/gist_id}","starred_url":"https://api.github.com/users/grzanka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grzanka/subscriptions","organizations_url":"https://api.github.com/users/grzanka/orgs","repos_url":"https://api.github.com/users/grzanka/repos","events_url":"https://api.github.com/users/grzanka/events{/privacy}","received_events_url":"https://api.github.com/users/grzanka/received_events","type":"User","site_admin":false},"body":"If I am correct check_output returns output of the command.\r\nPlease assign it first to the some variable, i.e. and log it with some description:\r\n\r\n```\r\nsrun_output = check_output(...)\r\nfile_logger.info(\"srun info {:s}\".format(...))\r\n``","created_at":"2017-08-29T08:41:07Z","updated_at":"2017-08-29T08:41:07Z","html_url":"https://github.com/DataMedSci/mcpartools/pull/85#discussion_r135727414","pull_request_url":"https://api.github.com/repos/DataMedSci/mcpartools/pulls/85","_links":{"self":{"href":"https://api.github.com/repos/DataMedSci/mcpartools/pulls/comments/135727414"},"html":{"href":"https://github.com/DataMedSci/mcpartools/pull/85#discussion_r135727414"},"pull_request":{"href":"https://api.github.com/repos/DataMedSci/mcpartools/pulls/85"}}},"pull_request":{"url":"https://api.github.com/repos/DataMedSci/mcpartools/pulls/85","id":137793125,"html_url":"https://github.com/DataMedSci/mcpartools/pull/85","diff_url":"https://github.com/DataMedSci/mcpartools/pull/85.diff","patch_url":"https://github.com/DataMedSci/mcpartools/pull/85.patch","issue_url":"https://api.github.com/repos/DataMedSci/mcpartools/issues/85","number":85,"state":"open","locked":false,"title":"Feature/logging","user":{"login":"PanSzczerba","id":26200369,"avatar_url":"https://avatars0.githubusercontent.com/u/26200369?v=4","gravatar_id":"","url":"https://api.github.com/users/PanSzczerba","html_url":"https://github.com/PanSzczerba","followers_url":"https://api.github.com/users/PanSzczerba/followers","following_url":"https://api.github.com/users/PanSzczerba/following{/other_user}","gists_url":"https://api.github.com/users/PanSzczerba/gists{/gist_id}","starred_url":"https://api.github.com/users/PanSzczerba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PanSzczerba/subscriptions","organizations_url":"https://api.github.com/users/PanSzczerba/orgs","repos_url":"https://api.github.com/users/PanSzczerba/repos","events_url":"https://api.github.com/users/PanSzczerba/events{/privacy}","received_events_url":"https://api.github.com/users/PanSzczerba/received_events","type":"User","site_admin":false},"body":"Added new log method in generator.py implementing features from \"better logging\" issue","created_at":"2017-08-26T10:05:46Z","updated_at":"2017-08-29T08:41:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"edd46ee68951c725a36c6081524db706f362e144","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":{"url":"https://api.github.com/repos/DataMedSci/mcpartools/milestones/13","html_url":"https://github.com/DataMedSci/mcpartools/milestone/13","labels_url":"https://api.github.com/repos/DataMedSci/mcpartools/milestones/13/labels","id":2653316,"number":13,"title":"Next release","description":"","creator":{"login":"ant6","id":5757700,"avatar_url":"https://avatars0.githubusercontent.com/u/5757700?v=4","gravatar_id":"","url":"https://api.github.com/users/ant6","html_url":"https://github.com/ant6","followers_url":"https://api.github.com/users/ant6/followers","following_url":"https://api.github.com/users/ant6/following{/other_user}","gists_url":"https://api.github.com/users/ant6/gists{/gist_id}","starred_url":"https://api.github.com/users/ant6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ant6/subscriptions","organizations_url":"https://api.github.com/users/ant6/orgs","repos_url":"https://api.github.com/users/ant6/repos","events_url":"https://api.github.com/users/ant6/events{/privacy}","received_events_url":"https://api.github.com/users/ant6/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":0,"state":"open","created_at":"2017-07-20T20:54:26Z","updated_at":"2017-08-28T20:07:08Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/DataMedSci/mcpartools/pulls/85/commits","review_comments_url":"https://api.github.com/repos/DataMedSci/mcpartools/pulls/85/comments","review_comment_url":"https://api.github.com/repos/DataMedSci/mcpartools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DataMedSci/mcpartools/issues/85/comments","statuses_url":"https://api.github.com/repos/DataMedSci/mcpartools/statuses/11c3a808e8b821b5e497aefb840f327a14ea28d8","head":{"label":"PanSzczerba:feature/logging","ref":"feature/logging","sha":"11c3a808e8b821b5e497aefb840f327a14ea28d8","user":{"login":"PanSzczerba","id":26200369,"avatar_url":"https://avatars0.githubusercontent.com/u/26200369?v=4","gravatar_id":"","url":"https://api.github.com/users/PanSzczerba","html_url":"https://github.com/PanSzczerba","followers_url":"https://api.github.com/users/PanSzczerba/followers","following_url":"https://api.github.com/users/PanSzczerba/following{/other_user}","gists_url":"https://api.github.com/users/PanSzczerba/gists{/gist_id}","starred_url":"https://api.github.com/users/PanSzczerba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PanSzczerba/subscriptions","organizations_url":"https://api.github.com/users/PanSzczerba/orgs","repos_url":"https://api.github.com/users/PanSzczerba/repos","events_url":"https://api.github.com/users/PanSzczerba/events{/privacy}","received_events_url":"https://api.github.com/users/PanSzczerba/received_events","type":"User","site_admin":false},"repo":{"id":98453133,"name":"mcpartools","full_name":"PanSzczerba/mcpartools","owner":{"login":"PanSzczerba","id":26200369,"avatar_url":"https://avatars0.githubusercontent.com/u/26200369?v=4","gravatar_id":"","url":"https://api.github.com/users/PanSzczerba","html_url":"https://github.com/PanSzczerba","followers_url":"https://api.github.com/users/PanSzczerba/followers","following_url":"https://api.github.com/users/PanSzczerba/following{/other_user}","gists_url":"https://api.github.com/users/PanSzczerba/gists{/gist_id}","starred_url":"https://api.github.com/users/PanSzczerba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PanSzczerba/subscriptions","organizations_url":"https://api.github.com/users/PanSzczerba/orgs","repos_url":"https://api.github.com/users/PanSzczerba/repos","events_url":"https://api.github.com/users/PanSzczerba/events{/privacy}","received_events_url":"https://api.github.com/users/PanSzczerba/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/PanSzczerba/mcpartools","description":"Set of tools to parallelize MC tools on clusters","fork":true,"url":"https://api.github.com/repos/PanSzczerba/mcpartools","forks_url":"https://api.github.com/repos/PanSzczerba/mcpartools/forks","keys_url":"https://api.github.com/repos/PanSzczerba/mcpartools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PanSzczerba/mcpartools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PanSzczerba/mcpartools/teams","hooks_url":"https://api.github.com/repos/PanSzczerba/mcpartools/hooks","issue_events_url":"https://api.github.com/repos/PanSzczerba/mcpartools/issues/events{/number}","events_url":"https://api.github.com/repos/PanSzczerba/mcpartools/events","assignees_url":"https://api.github.com/repos/PanSzczerba/mcpartools/assignees{/user}","branches_url":"https://api.github.com/repos/PanSzczerba/mcpartools/branches{/branch}","tags_url":"https://api.github.com/repos/PanSzczerba/mcpartools/tags","blobs_url":"https://api.github.com/repos/PanSzczerba/mcpartools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PanSzczerba/mcpartools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PanSzczerba/mcpartools/git/refs{/sha}","trees_url":"https://api.github.com/repos/PanSzczerba/mcpartools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PanSzczerba/mcpartools/statuses/{sha}","languages_url":"https://api.github.com/repos/PanSzczerba/mcpartools/languages","stargazers_url":"https://api.github.com/repos/PanSzczerba/mcpartools/stargazers","contributors_url":"https://api.github.com/repos/PanSzczerba/mcpartools/contributors","subscribers_url":"https://api.github.com/repos/PanSzczerba/mcpartools/subscribers","subscription_url":"https://api.github.com/repos/PanSzczerba/mcpartools/subscription","commits_url":"https://api.github.com/repos/PanSzczerba/mcpartools/commits{/sha}","git_commits_url":"https://api.github.com/repos/PanSzczerba/mcpartools/git/commits{/sha}","comments_url":"https://api.github.com/repos/PanSzczerba/mcpartools/comments{/number}","issue_comment_url":"https://api.github.com/repos/PanSzczerba/mcpartools/issues/comments{/number}","contents_url":"https://api.github.com/repos/PanSzczerba/mcpartools/contents/{+path}","compare_url":"https://api.github.com/repos/PanSzczerba/mcpartools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PanSzczerba/mcpartools/merges","archive_url":"https://api.github.com/repos/PanSzczerba/mcpartools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PanSzczerba/mcpartools/downloads","issues_url":"https://api.github.com/repos/PanSzczerba/mcpartools/issues{/number}","pulls_url":"https://api.github.com/repos/PanSzczerba/mcpartools/pulls{/number}","milestones_url":"https://api.github.com/repos/PanSzczerba/mcpartools/milestones{/number}","notifications_url":"https://api.github.com/repos/PanSzczerba/mcpartools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PanSzczerba/mcpartools/labels{/name}","releases_url":"https://api.github.com/repos/PanSzczerba/mcpartools/releases{/id}","deployments_url":"https://api.github.com/repos/PanSzczerba/mcpartools/deployments","created_at":"2017-07-26T18:21:50Z","updated_at":"2017-07-26T18:21:52Z","pushed_at":"2017-08-29T06:27:52Z","git_url":"git://github.com/PanSzczerba/mcpartools.git","ssh_url":"git@github.com:PanSzczerba/mcpartools.git","clone_url":"https://github.com/PanSzczerba/mcpartools.git","svn_url":"https://github.com/PanSzczerba/mcpartools","homepage":null,"size":151,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"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":"master"}},"base":{"label":"DataMedSci:master","ref":"master","sha":"e02ebcd4a95f9baf05d75e97fa13f423016448ba","user":{"login":"DataMedSci","id":19749591,"avatar_url":"https://avatars3.githubusercontent.com/u/19749591?v=4","gravatar_id":"","url":"https://api.github.com/users/DataMedSci","html_url":"https://github.com/DataMedSci","followers_url":"https://api.github.com/users/DataMedSci/followers","following_url":"https://api.github.com/users/DataMedSci/following{/other_user}","gists_url":"https://api.github.com/users/DataMedSci/gists{/gist_id}","starred_url":"https://api.github.com/users/DataMedSci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataMedSci/subscriptions","organizations_url":"https://api.github.com/users/DataMedSci/orgs","repos_url":"https://api.github.com/users/DataMedSci/repos","events_url":"https://api.github.com/users/DataMedSci/events{/privacy}","received_events_url":"https://api.github.com/users/DataMedSci/received_events","type":"Organization","site_admin":false},"repo":{"id":58126566,"name":"mcpartools","full_name":"DataMedSci/mcpartools","owner":{"login":"DataMedSci","id":19749591,"avatar_url":"https://avatars3.githubusercontent.com/u/19749591?v=4","gravatar_id":"","url":"https://api.github.com/users/DataMedSci","html_url":"https://github.com/DataMedSci","followers_url":"https://api.github.com/users/DataMedSci/followers","following_url":"https://api.github.com/users/DataMedSci/following{/other_user}","gists_url":"https://api.github.com/users/DataMedSci/gists{/gist_id}","starred_url":"https://api.github.com/users/DataMedSci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataMedSci/subscriptions","organizations_url":"https://api.github.com/users/DataMedSci/orgs","repos_url":"https://api.github.com/users/DataMedSci/repos","events_url":"https://api.github.com/users/DataMedSci/events{/privacy}","received_events_url":"https://api.github.com/users/DataMedSci/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DataMedSci/mcpartools","description":"Set of tools to parallelize MC tools on clusters","fork":false,"url":"https://api.github.com/repos/DataMedSci/mcpartools","forks_url":"https://api.github.com/repos/DataMedSci/mcpartools/forks","keys_url":"https://api.github.com/repos/DataMedSci/mcpartools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DataMedSci/mcpartools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DataMedSci/mcpartools/teams","hooks_url":"https://api.github.com/repos/DataMedSci/mcpartools/hooks","issue_events_url":"https://api.github.com/repos/DataMedSci/mcpartools/issues/events{/number}","events_url":"https://api.github.com/repos/DataMedSci/mcpartools/events","assignees_url":"https://api.github.com/repos/DataMedSci/mcpartools/assignees{/user}","branches_url":"https://api.github.com/repos/DataMedSci/mcpartools/branches{/branch}","tags_url":"https://api.github.com/repos/DataMedSci/mcpartools/tags","blobs_url":"https://api.github.com/repos/DataMedSci/mcpartools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DataMedSci/mcpartools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DataMedSci/mcpartools/git/refs{/sha}","trees_url":"https://api.github.com/repos/DataMedSci/mcpartools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DataMedSci/mcpartools/statuses/{sha}","languages_url":"https://api.github.com/repos/DataMedSci/mcpartools/languages","stargazers_url":"https://api.github.com/repos/DataMedSci/mcpartools/stargazers","contributors_url":"https://api.github.com/repos/DataMedSci/mcpartools/contributors","subscribers_url":"https://api.github.com/repos/DataMedSci/mcpartools/subscribers","subscription_url":"https://api.github.com/repos/DataMedSci/mcpartools/subscription","commits_url":"https://api.github.com/repos/DataMedSci/mcpartools/commits{/sha}","git_commits_url":"https://api.github.com/repos/DataMedSci/mcpartools/git/commits{/sha}","comments_url":"https://api.github.com/repos/DataMedSci/mcpartools/comments{/number}","issue_comment_url":"https://api.github.com/repos/DataMedSci/mcpartools/issues/comments{/number}","contents_url":"https://api.github.com/repos/DataMedSci/mcpartools/contents/{+path}","compare_url":"https://api.github.com/repos/DataMedSci/mcpartools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DataMedSci/mcpartools/merges","archive_url":"https://api.github.com/repos/DataMedSci/mcpartools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DataMedSci/mcpartools/downloads","issues_url":"https://api.github.com/repos/DataMedSci/mcpartools/issues{/number}","pulls_url":"https://api.github.com/repos/DataMedSci/mcpartools/pulls{/number}","milestones_url":"https://api.github.com/repos/DataMedSci/mcpartools/milestones{/number}","notifications_url":"https://api.github.com/repos/DataMedSci/mcpartools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DataMedSci/mcpartools/labels{/name}","releases_url":"https://api.github.com/repos/DataMedSci/mcpartools/releases{/id}","deployments_url":"https://api.github.com/repos/DataMedSci/mcpartools/deployments","created_at":"2016-05-05T11:35:18Z","updated_at":"2017-06-15T11:36:16Z","pushed_at":"2017-08-29T06:27:53Z","git_url":"git://github.com/DataMedSci/mcpartools.git","ssh_url":"git@github.com:DataMedSci/mcpartools.git","clone_url":"https://github.com/DataMedSci/mcpartools.git","svn_url":"https://github.com/DataMedSci/mcpartools","homepage":null,"size":146,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":7,"forks":2,"open_issues":7,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DataMedSci/mcpartools/pulls/85"},"html":{"href":"https://github.com/DataMedSci/mcpartools/pull/85"},"issue":{"href":"https://api.github.com/repos/DataMedSci/mcpartools/issues/85"},"comments":{"href":"https://api.github.com/repos/DataMedSci/mcpartools/issues/85/comments"},"review_comments":{"href":"https://api.github.com/repos/DataMedSci/mcpartools/pulls/85/comments"},"review_comment":{"href":"https://api.github.com/repos/DataMedSci/mcpartools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DataMedSci/mcpartools/pulls/85/commits"},"statuses":{"href":"https://api.github.com/repos/DataMedSci/mcpartools/statuses/11c3a808e8b821b5e497aefb840f327a14ea28d8"}}}}
{"actor":{"display_login":"grzanka"}}