For my logging purpose i want to log all the names of functions where my code is going
Does not matter who is calling the function , i want the the function name in whic
For my logging purpose i want to log all the names of functions where my code is going
Have you considered decorators?
import functools
def logme(f):
@functools.wraps(f)
def wrapped(*args, **kwargs):
print(f.__name__)
return f(*args, **kwargs)
return wrapped
@logme
def myfunction():
print("Doing some stuff")