MCPcopy Create free account
hub / github.com/dabeaz-course/python-mastery / logged

Function logged

Solutions/7_2/logcall.py:6–12  ·  view source on GitHub ↗
(func)

Source from the content-addressed store, hash-verified

4
5def logformat(fmt):
6 def logged(func):
7 print('Adding logging to', func.__name__)
8 @wraps(func)
9 def wrapper(*args,**kwargs):
10 print(fmt.format(func=func))
11 return func(*args, **kwargs)
12 return wrapper
13 return logged
14
15# Original no-argument @logged decorator defined in terms of the more

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected