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 pitrou
Recipients pitrou, serhiy.storchaka, vinay.sajip
Date 2017-06-01.09:38:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <78b242ae-5164-7306-091f-21517da761ef@free.fr>
In-reply-to <1496309297.87.0.0618746640986.issue30520@psf.upfronthosting.co.za>
Content
Le 01/06/2017 à 11:28, Serhiy Storchaka a écrit :
> 
> The idea LGTM. But we should first check that the logger is accessible by the name: getLogger(self.name) is self. The same is done when pickling classes, functions, etc. It shouldn't be a surprise on unpickler side.

Good idea.

> And maybe use not getLogger(), but different method which should fail if the logger doesn't exist rather than creating it.

I disagree. The fact that it creates a new logger if it doesn't exist is
pretty much by design.  Typically, if you have:

class MyObject:
    def __init__(self):
        self.logger = getLogger('myobject')

then unpickling the first MyObject instance in a new process should also
create the 'myobject' logger instead of failing.
History
Date User Action Args
2017-06-01 09:38:45pitrousetrecipients: + pitrou, vinay.sajip, serhiy.storchaka
2017-06-01 09:38:45pitroulinkissue30520 messages
2017-06-01 09:38:45pitroucreate