[issue30520] loggers can't be pickled

2017-06-06 Thread Vinay Sajip
Changes by Vinay Sajip : -- assignee: -> vinay.sajip resolution: -> fixed stage: needs patch -> resolved status: open -> closed ___ Python tracker

[issue30520] loggers can't be pickled

2017-06-06 Thread Vinay Sajip
Vinay Sajip added the comment: New changeset 6260d9f2039976372e0896d517b3c06e606eb169 by Vinay Sajip in branch 'master': bpo-30520: Implemented pickling for loggers. (#1956) https://github.com/python/cpython/commit/6260d9f2039976372e0896d517b3c06e606eb169 --

[issue30520] loggers can't be pickled

2017-06-05 Thread Vinay Sajip
Changes by Vinay Sajip : -- pull_requests: +2027 ___ Python tracker ___ ___

[issue30520] loggers can't be pickled

2017-06-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > The fact that it creates a new logger if it doesn't exist is > pretty much by design. May be. I don't have a strong opinion. -- ___ Python tracker

[issue30520] loggers can't be pickled

2017-06-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: 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

[issue30520] loggers can't be pickled

2017-06-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: 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. And maybe use not getLogger(), but

[issue30520] loggers can't be pickled

2017-06-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: Le 01/06/2017 à 09:14, Vinay Sajip a écrit : > > I am not sure it is a good idea to support pickling of loggers, as they are > singletons and generally aren't supposed to be instantiated other than by > calling logging.getLogger(name). Pickling them by name

[issue30520] loggers can't be pickled

2017-06-01 Thread Vinay Sajip
Vinay Sajip added the comment: I am not sure it is a good idea to support pickling of loggers, as they are singletons and generally aren't supposed to be instantiated other than by calling logging.getLogger(name). What's the use case for pickling them, giving that (as you say) just the name

[issue30520] loggers can't be pickled

2017-05-31 Thread Antoine Pitrou
New submission from Antoine Pitrou: Loggers could simply be pickled and unpickled by name, but pickle currently tries the hard way: >>> import pickle >>> import logging >>> log = logging.getLogger('foo') >>> pickle.dumps(log) Traceback (most recent call last): File "", line 1, in