You can use the `functools.wraps` decorator to deal with copying all (most) metadata from the wrapped function:
def trace(fn):
@functools.wraps(fn)
def worker(*args):
logging.info('Called %s with args %r', fn.__name__, args)
return fn(*args)
return worker
Docs: http://docs.python.org/3/library/functools.html#functools.wr...