Message294923
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. |
|
Date |
User |
Action |
Args |
2017-06-01 09:38:45 | pitrou | set | recipients:
+ pitrou, vinay.sajip, serhiy.storchaka |
2017-06-01 09:38:45 | pitrou | link | issue30520 messages |
2017-06-01 09:38:45 | pitrou | create | |
|