[issue7120] logging depends on multiprocessing

Vinay Sajip report at bugs.python.org
Wed Oct 14 12:00:40 CEST 2009


Vinay Sajip <vinay_sajip at yahoo.co.uk> added the comment:

> Whatever the value of logMultiprocessing is, I suggest to not import the

> multiprocessing module if the application did not import it before:
> something like:
> 
>     if "multiprocessing" in sys.modules:
>         from multiprocessing import current_process
>         self.processName = current_process().name
>     else:
>         # current_process().name returns this the first time
>         self.processName = 'MainProcess'
> 

I suggested "None" because that was the value used in r70348 when logMultipocessing is False. I presume you're only talking about when it's True? I'm confused by your "Whatever the value of logMultiprocessing is, ...".

Should the system behaviour really change depending on whether multiprocessing was already imported? I can see why you're suggesting it but it makes me a little uneasy :-S

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7120>
_______________________________________


More information about the Python-bugs-list mailing list