{"action":"created","issue":{"url":"https://api.github.com/repos/digidotcom/python-xbee/issues/57","repository_url":"https://api.github.com/repos/digidotcom/python-xbee","labels_url":"https://api.github.com/repos/digidotcom/python-xbee/issues/57/labels{/name}","comments_url":"https://api.github.com/repos/digidotcom/python-xbee/issues/57/comments","events_url":"https://api.github.com/repos/digidotcom/python-xbee/issues/57/events","html_url":"https://github.com/digidotcom/python-xbee/issues/57","id":351157060,"node_id":"MDU6SXNzdWUzNTExNTcwNjA=","number":57,"title":"Logger prints multiple times","user":{"login":"FRVisser","id":8135903,"node_id":"MDQ6VXNlcjgxMzU5MDM=","avatar_url":"https://avatars2.githubusercontent.com/u/8135903?v=4","gravatar_id":"","url":"https://api.github.com/users/FRVisser","html_url":"https://github.com/FRVisser","followers_url":"https://api.github.com/users/FRVisser/followers","following_url":"https://api.github.com/users/FRVisser/following{/other_user}","gists_url":"https://api.github.com/users/FRVisser/gists{/gist_id}","starred_url":"https://api.github.com/users/FRVisser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FRVisser/subscriptions","organizations_url":"https://api.github.com/users/FRVisser/orgs","repos_url":"https://api.github.com/users/FRVisser/repos","events_url":"https://api.github.com/users/FRVisser/events{/privacy}","received_events_url":"https://api.github.com/users/FRVisser/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-08-16T11:03:40Z","updated_at":"2018-09-07T15:49:10Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nI have a bit of strange issue. When I run my application the logger prints lines multiple times. For instance after while when I close my application:\r\n\r\n```\r\n/dev/tty.usbserial-1420 port closed\r\n/dev/tty.usbserial-1420 port closed\r\n/dev/tty.usbserial-1420 port closed\r\n/dev/tty.usbserial-1420 port closed\r\n/dev/tty.usbserial-1420 port closed\r\n/dev/tty.usbserial-1420 port closed\r\n/dev/tty.usbserial-1420 port closed\r\n/dev/tty.usbserial-1420 port closed\r\n/dev/tty.usbserial-1420 port closed\r\n```\r\n\r\nEven the last message I received was printed 7 times. As my program runs longer this number increases.\r\n\r\nI checked, by adding some debug printing in the library, and the printed message is actually logged once but printed multiple times. And my program isn't leaking any memory or something. So everything does look fine.\r\n\r\nI have been searching on it a little bit and the internet is full of the same questions regarding python logger. Like ([stackoverflow](https://stackoverflow.com/questions/47008864/how-to-prevent-logger-printing-same-information-multiple-times)):\r\n\r\n> So every time you instantiate your class you add new handlers to the logger and every handler prints a line. \r\n\r\nAny idea how to solve this? Do you think this issue be related to having multiple logger handlers?\r\n\r\nThanks,\r\nFokko"},"comment":{"url":"https://api.github.com/repos/digidotcom/python-xbee/issues/comments/419482515","html_url":"https://github.com/digidotcom/python-xbee/issues/57#issuecomment-419482515","issue_url":"https://api.github.com/repos/digidotcom/python-xbee/issues/57","id":419482515,"node_id":"MDEyOklzc3VlQ29tbWVudDQxOTQ4MjUxNQ==","user":{"login":"rubenmoral","id":8180020,"node_id":"MDQ6VXNlcjgxODAwMjA=","avatar_url":"https://avatars3.githubusercontent.com/u/8180020?v=4","gravatar_id":"","url":"https://api.github.com/users/rubenmoral","html_url":"https://github.com/rubenmoral","followers_url":"https://api.github.com/users/rubenmoral/followers","following_url":"https://api.github.com/users/rubenmoral/following{/other_user}","gists_url":"https://api.github.com/users/rubenmoral/gists{/gist_id}","starred_url":"https://api.github.com/users/rubenmoral/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rubenmoral/subscriptions","organizations_url":"https://api.github.com/users/rubenmoral/orgs","repos_url":"https://api.github.com/users/rubenmoral/repos","events_url":"https://api.github.com/users/rubenmoral/events{/privacy}","received_events_url":"https://api.github.com/users/rubenmoral/received_events","type":"User","site_admin":false},"created_at":"2018-09-07T15:49:10Z","updated_at":"2018-09-07T15:49:10Z","author_association":"MEMBER","body":"Hi @FRVisser,\r\n\r\nWe haven't had time to investigate your issue, we apologize for that.\r\n\r\nYes, there is a way. The Python's `logging` package allows you to change the logging level or even disable all logging calls. To do so, add these lines to your code:\r\n\r\n```\r\nimport logging\r\n\r\n[...]\r\n\r\nlogging.disable()\r\n```\r\n\r\nYou can find more information at https://docs.python.org/3/library/logging.html#logging.disable.\r\n\r\nRegards."}}
{"actor":{"display_login":"rubenmoral"}}