{"action":"created","comment":{"url":"https://api.github.com/repos/hpcugent/vsc-base/pulls/comments/57488685","id":57488685,"diff_hunk":"@@ -562,6 +586,28 @@ def _logToSomething(handlerclass, handleropts, loggeroption, enable=True, name=N\n     return handler\n \n \n+def _getScreenLogFormatter(stream, colorize='never'):\n+    \"\"\"\n+    Return a log formatter, with optional colorization features.\n+\n+    Second argument `colorize` controls whether the formatter\n+    can use ANSI terminal escape sequences:\n+\n+    * ``'never'`` (default) forces use of the plain `logging.Formatter` class;\n+    * ``'always'`` forces use of the colorizing formatter;\n+    * ``'auto'`` selects the colorizing formatter depending on whether `stream` is connected to a terminal.","path":"lib/vsc/utils/fancylogger.py","position":94,"original_position":94,"commit_id":"1813d391a8be6d220af133c8902a125003b6a5a0","original_commit_id":"1813d391a8be6d220af133c8902a125003b6a5a0","user":{"login":"riccardomurri","id":447228,"avatar_url":"https://avatars.githubusercontent.com/u/447228?v=3","gravatar_id":"","url":"https://api.github.com/users/riccardomurri","html_url":"https://github.com/riccardomurri","followers_url":"https://api.github.com/users/riccardomurri/followers","following_url":"https://api.github.com/users/riccardomurri/following{/other_user}","gists_url":"https://api.github.com/users/riccardomurri/gists{/gist_id}","starred_url":"https://api.github.com/users/riccardomurri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/riccardomurri/subscriptions","organizations_url":"https://api.github.com/users/riccardomurri/orgs","repos_url":"https://api.github.com/users/riccardomurri/repos","events_url":"https://api.github.com/users/riccardomurri/events{/privacy}","received_events_url":"https://api.github.com/users/riccardomurri/received_events","type":"User","site_admin":false},"body":"> > +    Second argument `colorize` controls whether the formatter\n> > +    can use ANSI terminal escape sequences:\n> > +\n> > +    * ``'never'`` (default) forces use of the plain `logging.Formatter` class;\n> > +    * ``'always'`` forces use of the colorizing formatter;\n> > +    * ``'auto'`` selects the colorizing formatter depending on whether `stream` is connected to a terminal.\n>\n> so auto+redirected stdout should not be colorised?\n\nNo. That's the whole point of having `auto`.\n","created_at":"2016-03-25T20:42:48Z","updated_at":"2016-03-25T20:42:48Z","html_url":"https://github.com/hpcugent/vsc-base/pull/225#discussion_r57488685","pull_request_url":"https://api.github.com/repos/hpcugent/vsc-base/pulls/225","_links":{"self":{"href":"https://api.github.com/repos/hpcugent/vsc-base/pulls/comments/57488685"},"html":{"href":"https://github.com/hpcugent/vsc-base/pull/225#discussion_r57488685"},"pull_request":{"href":"https://api.github.com/repos/hpcugent/vsc-base/pulls/225"}}},"pull_request":{"url":"https://api.github.com/repos/hpcugent/vsc-base/pulls/225","id":64164277,"html_url":"https://github.com/hpcugent/vsc-base/pull/225","diff_url":"https://github.com/hpcugent/vsc-base/pull/225.diff","patch_url":"https://github.com/hpcugent/vsc-base/pull/225.patch","issue_url":"https://api.github.com/repos/hpcugent/vsc-base/issues/225","number":225,"state":"open","locked":false,"title":"Add support for colorization of log messages sent to the screen.","user":{"login":"riccardomurri","id":447228,"avatar_url":"https://avatars.githubusercontent.com/u/447228?v=3","gravatar_id":"","url":"https://api.github.com/users/riccardomurri","html_url":"https://github.com/riccardomurri","followers_url":"https://api.github.com/users/riccardomurri/followers","following_url":"https://api.github.com/users/riccardomurri/following{/other_user}","gists_url":"https://api.github.com/users/riccardomurri/gists{/gist_id}","starred_url":"https://api.github.com/users/riccardomurri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/riccardomurri/subscriptions","organizations_url":"https://api.github.com/users/riccardomurri/orgs","repos_url":"https://api.github.com/users/riccardomurri/repos","events_url":"https://api.github.com/users/riccardomurri/events{/privacy}","received_events_url":"https://api.github.com/users/riccardomurri/received_events","type":"User","site_admin":false},"body":"The support depends on the external modules `coloredlogs` and\r\n`humanfriendly`; if they are not available, logs will not be colorized\r\nno matter what.\r\n\r\nAn additional option to `fancylogger.logToScreen()` allows turning log\r\ncolorization depending on terminal capabilities, or on/off unconditionally.\r\n\r\n**Note that this makes EasyBuild logs colored by default!**","created_at":"2016-03-25T13:56:38Z","updated_at":"2016-03-25T20:42:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2998bae3fc317fc6486d2af8b917d010f320bc7d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hpcugent/vsc-base/pulls/225/commits","review_comments_url":"https://api.github.com/repos/hpcugent/vsc-base/pulls/225/comments","review_comment_url":"https://api.github.com/repos/hpcugent/vsc-base/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hpcugent/vsc-base/issues/225/comments","statuses_url":"https://api.github.com/repos/hpcugent/vsc-base/statuses/1813d391a8be6d220af133c8902a125003b6a5a0","head":{"label":"riccardomurri:coloredlogs","ref":"coloredlogs","sha":"1813d391a8be6d220af133c8902a125003b6a5a0","user":{"login":"riccardomurri","id":447228,"avatar_url":"https://avatars.githubusercontent.com/u/447228?v=3","gravatar_id":"","url":"https://api.github.com/users/riccardomurri","html_url":"https://github.com/riccardomurri","followers_url":"https://api.github.com/users/riccardomurri/followers","following_url":"https://api.github.com/users/riccardomurri/following{/other_user}","gists_url":"https://api.github.com/users/riccardomurri/gists{/gist_id}","starred_url":"https://api.github.com/users/riccardomurri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/riccardomurri/subscriptions","organizations_url":"https://api.github.com/users/riccardomurri/orgs","repos_url":"https://api.github.com/users/riccardomurri/repos","events_url":"https://api.github.com/users/riccardomurri/events{/privacy}","received_events_url":"https://api.github.com/users/riccardomurri/received_events","type":"User","site_admin":false},"repo":{"id":54719926,"name":"vsc-base","full_name":"riccardomurri/vsc-base","owner":{"login":"riccardomurri","id":447228,"avatar_url":"https://avatars.githubusercontent.com/u/447228?v=3","gravatar_id":"","url":"https://api.github.com/users/riccardomurri","html_url":"https://github.com/riccardomurri","followers_url":"https://api.github.com/users/riccardomurri/followers","following_url":"https://api.github.com/users/riccardomurri/following{/other_user}","gists_url":"https://api.github.com/users/riccardomurri/gists{/gist_id}","starred_url":"https://api.github.com/users/riccardomurri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/riccardomurri/subscriptions","organizations_url":"https://api.github.com/users/riccardomurri/orgs","repos_url":"https://api.github.com/users/riccardomurri/repos","events_url":"https://api.github.com/users/riccardomurri/events{/privacy}","received_events_url":"https://api.github.com/users/riccardomurri/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/riccardomurri/vsc-base","description":"Basic Python libraries used by UGent's HPC group","fork":true,"url":"https://api.github.com/repos/riccardomurri/vsc-base","forks_url":"https://api.github.com/repos/riccardomurri/vsc-base/forks","keys_url":"https://api.github.com/repos/riccardomurri/vsc-base/keys{/key_id}","collaborators_url":"https://api.github.com/repos/riccardomurri/vsc-base/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/riccardomurri/vsc-base/teams","hooks_url":"https://api.github.com/repos/riccardomurri/vsc-base/hooks","issue_events_url":"https://api.github.com/repos/riccardomurri/vsc-base/issues/events{/number}","events_url":"https://api.github.com/repos/riccardomurri/vsc-base/events","assignees_url":"https://api.github.com/repos/riccardomurri/vsc-base/assignees{/user}","branches_url":"https://api.github.com/repos/riccardomurri/vsc-base/branches{/branch}","tags_url":"https://api.github.com/repos/riccardomurri/vsc-base/tags","blobs_url":"https://api.github.com/repos/riccardomurri/vsc-base/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/riccardomurri/vsc-base/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/riccardomurri/vsc-base/git/refs{/sha}","trees_url":"https://api.github.com/repos/riccardomurri/vsc-base/git/trees{/sha}","statuses_url":"https://api.github.com/repos/riccardomurri/vsc-base/statuses/{sha}","languages_url":"https://api.github.com/repos/riccardomurri/vsc-base/languages","stargazers_url":"https://api.github.com/repos/riccardomurri/vsc-base/stargazers","contributors_url":"https://api.github.com/repos/riccardomurri/vsc-base/contributors","subscribers_url":"https://api.github.com/repos/riccardomurri/vsc-base/subscribers","subscription_url":"https://api.github.com/repos/riccardomurri/vsc-base/subscription","commits_url":"https://api.github.com/repos/riccardomurri/vsc-base/commits{/sha}","git_commits_url":"https://api.github.com/repos/riccardomurri/vsc-base/git/commits{/sha}","comments_url":"https://api.github.com/repos/riccardomurri/vsc-base/comments{/number}","issue_comment_url":"https://api.github.com/repos/riccardomurri/vsc-base/issues/comments{/number}","contents_url":"https://api.github.com/repos/riccardomurri/vsc-base/contents/{+path}","compare_url":"https://api.github.com/repos/riccardomurri/vsc-base/compare/{base}...{head}","merges_url":"https://api.github.com/repos/riccardomurri/vsc-base/merges","archive_url":"https://api.github.com/repos/riccardomurri/vsc-base/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/riccardomurri/vsc-base/downloads","issues_url":"https://api.github.com/repos/riccardomurri/vsc-base/issues{/number}","pulls_url":"https://api.github.com/repos/riccardomurri/vsc-base/pulls{/number}","milestones_url":"https://api.github.com/repos/riccardomurri/vsc-base/milestones{/number}","notifications_url":"https://api.github.com/repos/riccardomurri/vsc-base/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/riccardomurri/vsc-base/labels{/name}","releases_url":"https://api.github.com/repos/riccardomurri/vsc-base/releases{/id}","deployments_url":"https://api.github.com/repos/riccardomurri/vsc-base/deployments","created_at":"2016-03-25T13:22:19Z","updated_at":"2016-03-25T13:22:20Z","pushed_at":"2016-03-25T16:36:07Z","git_url":"git://github.com/riccardomurri/vsc-base.git","ssh_url":"git@github.com:riccardomurri/vsc-base.git","clone_url":"https://github.com/riccardomurri/vsc-base.git","svn_url":"https://github.com/riccardomurri/vsc-base","homepage":null,"size":1221,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"master"}},"base":{"label":"hpcugent:master","ref":"master","sha":"0cc76b2d5412fd5eecffeda17b6c966e0be34f74","user":{"login":"hpcugent","id":1515263,"avatar_url":"https://avatars.githubusercontent.com/u/1515263?v=3","gravatar_id":"","url":"https://api.github.com/users/hpcugent","html_url":"https://github.com/hpcugent","followers_url":"https://api.github.com/users/hpcugent/followers","following_url":"https://api.github.com/users/hpcugent/following{/other_user}","gists_url":"https://api.github.com/users/hpcugent/gists{/gist_id}","starred_url":"https://api.github.com/users/hpcugent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hpcugent/subscriptions","organizations_url":"https://api.github.com/users/hpcugent/orgs","repos_url":"https://api.github.com/users/hpcugent/repos","events_url":"https://api.github.com/users/hpcugent/events{/privacy}","received_events_url":"https://api.github.com/users/hpcugent/received_events","type":"Organization","site_admin":false},"repo":{"id":7765704,"name":"vsc-base","full_name":"hpcugent/vsc-base","owner":{"login":"hpcugent","id":1515263,"avatar_url":"https://avatars.githubusercontent.com/u/1515263?v=3","gravatar_id":"","url":"https://api.github.com/users/hpcugent","html_url":"https://github.com/hpcugent","followers_url":"https://api.github.com/users/hpcugent/followers","following_url":"https://api.github.com/users/hpcugent/following{/other_user}","gists_url":"https://api.github.com/users/hpcugent/gists{/gist_id}","starred_url":"https://api.github.com/users/hpcugent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hpcugent/subscriptions","organizations_url":"https://api.github.com/users/hpcugent/orgs","repos_url":"https://api.github.com/users/hpcugent/repos","events_url":"https://api.github.com/users/hpcugent/events{/privacy}","received_events_url":"https://api.github.com/users/hpcugent/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hpcugent/vsc-base","description":"Basic Python libraries used by UGent's HPC group","fork":false,"url":"https://api.github.com/repos/hpcugent/vsc-base","forks_url":"https://api.github.com/repos/hpcugent/vsc-base/forks","keys_url":"https://api.github.com/repos/hpcugent/vsc-base/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hpcugent/vsc-base/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hpcugent/vsc-base/teams","hooks_url":"https://api.github.com/repos/hpcugent/vsc-base/hooks","issue_events_url":"https://api.github.com/repos/hpcugent/vsc-base/issues/events{/number}","events_url":"https://api.github.com/repos/hpcugent/vsc-base/events","assignees_url":"https://api.github.com/repos/hpcugent/vsc-base/assignees{/user}","branches_url":"https://api.github.com/repos/hpcugent/vsc-base/branches{/branch}","tags_url":"https://api.github.com/repos/hpcugent/vsc-base/tags","blobs_url":"https://api.github.com/repos/hpcugent/vsc-base/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hpcugent/vsc-base/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hpcugent/vsc-base/git/refs{/sha}","trees_url":"https://api.github.com/repos/hpcugent/vsc-base/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hpcugent/vsc-base/statuses/{sha}","languages_url":"https://api.github.com/repos/hpcugent/vsc-base/languages","stargazers_url":"https://api.github.com/repos/hpcugent/vsc-base/stargazers","contributors_url":"https://api.github.com/repos/hpcugent/vsc-base/contributors","subscribers_url":"https://api.github.com/repos/hpcugent/vsc-base/subscribers","subscription_url":"https://api.github.com/repos/hpcugent/vsc-base/subscription","commits_url":"https://api.github.com/repos/hpcugent/vsc-base/commits{/sha}","git_commits_url":"https://api.github.com/repos/hpcugent/vsc-base/git/commits{/sha}","comments_url":"https://api.github.com/repos/hpcugent/vsc-base/comments{/number}","issue_comment_url":"https://api.github.com/repos/hpcugent/vsc-base/issues/comments{/number}","contents_url":"https://api.github.com/repos/hpcugent/vsc-base/contents/{+path}","compare_url":"https://api.github.com/repos/hpcugent/vsc-base/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hpcugent/vsc-base/merges","archive_url":"https://api.github.com/repos/hpcugent/vsc-base/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hpcugent/vsc-base/downloads","issues_url":"https://api.github.com/repos/hpcugent/vsc-base/issues{/number}","pulls_url":"https://api.github.com/repos/hpcugent/vsc-base/pulls{/number}","milestones_url":"https://api.github.com/repos/hpcugent/vsc-base/milestones{/number}","notifications_url":"https://api.github.com/repos/hpcugent/vsc-base/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hpcugent/vsc-base/labels{/name}","releases_url":"https://api.github.com/repos/hpcugent/vsc-base/releases{/id}","deployments_url":"https://api.github.com/repos/hpcugent/vsc-base/deployments","created_at":"2013-01-23T01:51:31Z","updated_at":"2016-02-10T11:05:56Z","pushed_at":"2016-03-25T16:36:07Z","git_url":"git://github.com/hpcugent/vsc-base.git","ssh_url":"git@github.com:hpcugent/vsc-base.git","clone_url":"https://github.com/hpcugent/vsc-base.git","svn_url":"https://github.com/hpcugent/vsc-base","homepage":null,"size":1313,"stargazers_count":9,"watchers_count":9,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":34,"mirror_url":null,"open_issues_count":30,"forks":34,"open_issues":30,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hpcugent/vsc-base/pulls/225"},"html":{"href":"https://github.com/hpcugent/vsc-base/pull/225"},"issue":{"href":"https://api.github.com/repos/hpcugent/vsc-base/issues/225"},"comments":{"href":"https://api.github.com/repos/hpcugent/vsc-base/issues/225/comments"},"review_comments":{"href":"https://api.github.com/repos/hpcugent/vsc-base/pulls/225/comments"},"review_comment":{"href":"https://api.github.com/repos/hpcugent/vsc-base/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hpcugent/vsc-base/pulls/225/commits"},"statuses":{"href":"https://api.github.com/repos/hpcugent/vsc-base/statuses/1813d391a8be6d220af133c8902a125003b6a5a0"}}}}