This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author yasuiniko
Recipients docs@python, yasuiniko
Date 2016-08-23.12:22:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1471954933.3.0.792473866028.issue27837@psf.upfronthosting.co.za>
In-reply-to
Content
Removed the unnecessary listener function and changed the worker loggers from root to children. Also replaced print statements with logging statements and a stdout handler to illustrate the usefulness of handler levels. This version also doesn't require a manual listener process or thread, since it's all handled by the interpreter in the background. 

As far as I know, it's just a one-line change from multiprocessing to threading, so it should be easy to adapt this example to improve the threading example as well.

The previous example was hard for me to understand, and when I integrated it to my code, printed duplicates of every log item to all my handlers (including stdout) even though I hadn't added a stdout handler. Evidently this was my fault, since the original example code doesn't do that, but this updated code should be cleaner and easier to understand to avoid such integration problems in the first place. I hope it is a worthy contribution the docs. Feel free to provide any tips to improve it.
History
Date User Action Args
2016-08-23 12:22:13yasuinikosetrecipients: + yasuiniko, docs@python
2016-08-23 12:22:13yasuinikosetmessageid: <1471954933.3.0.792473866028.issue27837@psf.upfronthosting.co.za>
2016-08-23 12:22:13yasuinikolinkissue27837 messages
2016-08-23 12:22:12yasuinikocreate