In Lua, is it possible to know which function has called the current function.
For instance
function a()
get_calling_function() --Should print function b
end
function b()
a()
end
Is something like this possible?
Does the debug library have such functionality?
You could use
debug.traceback():which would print:
stack traceback: ./test.lua:45: in function 'a' ./test.lua:50: in function 'b' ./test.lua:53: in main chunk [C]: in ?