{"action":"created","issue":{"url":"https://api.github.com/repos/hyperspy/hyperspy/issues/749","repository_url":"https://api.github.com/repos/hyperspy/hyperspy","labels_url":"https://api.github.com/repos/hyperspy/hyperspy/issues/749/labels{/name}","comments_url":"https://api.github.com/repos/hyperspy/hyperspy/issues/749/comments","events_url":"https://api.github.com/repos/hyperspy/hyperspy/issues/749/events","html_url":"https://github.com/hyperspy/hyperspy/issues/749","id":115039980,"number":749,"title":"Implement logging","user":{"login":"vidartf","id":510760,"avatar_url":"https://avatars.githubusercontent.com/u/510760?v=3","gravatar_id":"","url":"https://api.github.com/users/vidartf","html_url":"https://github.com/vidartf","followers_url":"https://api.github.com/users/vidartf/followers","following_url":"https://api.github.com/users/vidartf/following{/other_user}","gists_url":"https://api.github.com/users/vidartf/gists{/gist_id}","starred_url":"https://api.github.com/users/vidartf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vidartf/subscriptions","organizations_url":"https://api.github.com/users/vidartf/orgs","repos_url":"https://api.github.com/users/vidartf/repos","events_url":"https://api.github.com/users/vidartf/events{/privacy}","received_events_url":"https://api.github.com/users/vidartf/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hyperspy/hyperspy/labels/proposal","name":"proposal","color":"02d7e1"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/hyperspy/hyperspy/milestones/10","html_url":"https://github.com/hyperspy/hyperspy/milestones/Wish%20list","labels_url":"https://api.github.com/repos/hyperspy/hyperspy/milestones/10/labels","id":936841,"number":10,"title":"Wish list","description":"Feature requests that have not been implemented yet nor we know when they will be implemented.","creator":{"login":"francisco-dlp","id":989719,"avatar_url":"https://avatars.githubusercontent.com/u/989719?v=3","gravatar_id":"","url":"https://api.github.com/users/francisco-dlp","html_url":"https://github.com/francisco-dlp","followers_url":"https://api.github.com/users/francisco-dlp/followers","following_url":"https://api.github.com/users/francisco-dlp/following{/other_user}","gists_url":"https://api.github.com/users/francisco-dlp/gists{/gist_id}","starred_url":"https://api.github.com/users/francisco-dlp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/francisco-dlp/subscriptions","organizations_url":"https://api.github.com/users/francisco-dlp/orgs","repos_url":"https://api.github.com/users/francisco-dlp/repos","events_url":"https://api.github.com/users/francisco-dlp/events{/privacy}","received_events_url":"https://api.github.com/users/francisco-dlp/received_events","type":"User","site_admin":false},"open_issues":44,"closed_issues":1,"state":"open","created_at":"2015-01-15T14:34:30Z","updated_at":"2016-04-01T14:03:17Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2015-11-04T12:14:03Z","updated_at":"2016-04-07T20:57:20Z","closed_at":null,"body":"Depending on your situation, you might want varying degrees of output from hyperspy (and its dependencies). Currently, the code includes the sporadic `print` statements, but its use is inconsistent, as highlighted in PR #748. A better alternative would be to use the [standard logging package](https://docs.python.org/2/library/logging.html), as that allows for a grading of importance of messages, which can then be filtered before being displayed to the user. It would also ease development, as a detailed/verbose output can help when debugging and/or trying to understand exactly what something does.\r\n\r\nIn the short term, this would only affect how `print` statements are removed (i.e. replaced by logging calls), but in the long term this would hopefully also include new logging statements in existing code. The most important logging level to include would be `information`, as that would serve best to replace today's print statement. Also, `critical`/`error`/`warning` is already handled by exceptions/warnings. Then `debug` could be added slowly over time (unless someone volunteers for performing an overhaul).\r\n\r\nSpecifically, I'd suggest using named loggers:\r\n> A good convention to use when naming loggers is to use a module-level logger, in each module which uses logging, named as follows:\r\n> `logger = logging.getLogger(__name__)`\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/hyperspy/hyperspy/issues/comments/207084332","html_url":"https://github.com/hyperspy/hyperspy/issues/749#issuecomment-207084332","issue_url":"https://api.github.com/repos/hyperspy/hyperspy/issues/749","id":207084332,"user":{"login":"dnjohnstone","id":10629656,"avatar_url":"https://avatars.githubusercontent.com/u/10629656?v=3","gravatar_id":"","url":"https://api.github.com/users/dnjohnstone","html_url":"https://github.com/dnjohnstone","followers_url":"https://api.github.com/users/dnjohnstone/followers","following_url":"https://api.github.com/users/dnjohnstone/following{/other_user}","gists_url":"https://api.github.com/users/dnjohnstone/gists{/gist_id}","starred_url":"https://api.github.com/users/dnjohnstone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnjohnstone/subscriptions","organizations_url":"https://api.github.com/users/dnjohnstone/orgs","repos_url":"https://api.github.com/users/dnjohnstone/repos","events_url":"https://api.github.com/users/dnjohnstone/events{/privacy}","received_events_url":"https://api.github.com/users/dnjohnstone/received_events","type":"User","site_admin":false},"created_at":"2016-04-07T20:57:20Z","updated_at":"2016-04-07T20:57:20Z","body":"@vidartf Is this one done now? I thought #877 would close this, or did I miss something that remains to be done?"}}