def logDecorator(func):

    def wrapper(*args, **kwargs):
        print('Before', func.__name__)
ret = func(*args, **kwargs)
print('After', func.__name__)
return ret
return wrapper


class MyClass(object):
    pass
How do I add a method with a decorator to a class in python?