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
You probably want inspect.getframeinfo(frame).function:
import inspect def whoami(): frame = inspect.currentframe() return inspect.getframeinfo(frame).function def foo(): print(whoami()) foo()
prints
whoami