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 could be used? In general, it's not needed to 
have loggers as part of an object instance, so I don't quite see where the need 
to pickle comes from.

One could implement __getstate__() to just return the name, but there is no 
corresponding obvious implementation of __setstate__() because loggers aren't 
meant to be instantiated via unpickling.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30520>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to