import inspect def to_print(*args): frame = inspect.currentframe() func_name = frame.f_back.f_code.co_name print("func:{}".format(func_name), args)