import functools import time
def Log(text=""): def heheda(func): @functools.wraps(func) def asd(args,**kw): print("beginCall") print("%s%s"%(text,func.name)) asd = func(args,**kw) print("EndCall") return asd return asd return heheda
@Log()
def now(): print(time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time())))
now()
Sign in to make a reply
沉默的斑竹
import functools import time
def Log(text=""): def heheda(func): @functools.wraps(func) def asd(args,**kw): print("beginCall") print("%s%s"%(text,func.name)) asd = func(args,**kw) print("EndCall") return asd return asd return heheda
@Log()
def now(): print(time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time())))
now()