Author jango
Recipients jango, pitrou, vinay.sajip
Date 2011-12-11.00:54:49
SpamBayes Score 0.0
Marked as misclassified No
Message-id <4EE3FF56.3050901@gmail.com>
In-reply-to <1323561144.62.0.432430357626.issue13569@psf.upfronthosting.co.za>
Content
Here is a link for example in question:
https://github.com/jango/calculon/blob/master/calculon/calculon.py

Previously, I would pass logger instance from Calculon class to 
_Producer and _Consumer classes. In the current revision, I removed the 
logging completely since I don't feel like it was serving much purpose 
anyway.

On 11-12-10 06:52 PM, Vinay Sajip wrote:
> Vinay Sajip<vinay_sajip@yahoo.co.uk>  added the comment:
>
> You shouldn't need to pickle loggers, because loggers just represent where in your application something happens (that being determined by the logger name). The logger name is just a string, and if you need to communicate that across e.g. a process boundary, just sending the name should be enough.
>
> Ideally in a multiprocessing application, logging initialisation should happen after the fork() or CreateProcess() which creates the child process. It's best if loggers are named after the module which logs events (using __name__, which means you don't need to pass the name around - but even if you need to for some reason, you still don't need to pickle a logger or pass it around as a parameter).
>
> You *can* use logging safely in terms of the locks it creates to serialise access to I/O resources and to protect shared data structures, but you still need to understand what's happening and allow for it in your own coding.
>
> To summarise, I don't quite see from the information in this issue why it is desirable to pickle loggers, and the GitHub link doesn't work, so I can't look at Nikita's example, either. So if a better justification isn't available, I would like to close the issue.
>
> ----------
>
> _______________________________________
> Python tracker<report@bugs.python.org>
> <http://bugs.python.org/issue13569>
> _______________________________________
History
Date User Action Args
2011-12-11 00:54:50jangosetrecipients: + jango, vinay.sajip, pitrou
2011-12-11 00:54:49jangolinkissue13569 messages
2011-12-11 00:54:49jangocreate