def record_log(log_object):

    def deco(func):

        def wrap(*args, **kwargs):
            rs = func(*args, **kwargs)
if rs:
    log_object.record('success')
else:
    log_object.record('fail')
return rs
return wrap
return deco
how to use decorator in a class