Working on a project that requires that I am able to pickle the container object at any point, since we expect it to fail on external conditions quite frequently and be able to
You could have used dill here, which can pickle loggers and locks.
dill
>>> class foo: ... def __init__(self): ... self.logger = logging.getLogger("package.foo") ... >>> import dill >>> import logging >>> >>> f = foo() >>> _f = dill.dumps(f) >>> f_ = dill.loads(_f) >>> f_.logger