LogWrapped should ignore __enter__, __exit__

This commit is contained in:
Ask Solem 2011-08-15 12:41:36 +01:00
parent b86c129a82
commit df0c67feb0
1 changed files with 2 additions and 1 deletions

View File

@ -14,6 +14,7 @@ def setup_logging(loglevel=logging.DEBUG, loggers=["kombu.connection",
class Logwrapped(object):
__ignore = ("__enter__", "__exit__")
def __init__(self, instance, logger=None, ident=None):
self.instance = instance
@ -23,7 +24,7 @@ class Logwrapped(object):
def __getattr__(self, key):
meth = getattr(self.instance, key)
if not callable(meth):
if not callable(meth) or key in self.__ignore:
return meth
@wraps(meth)