How can I get the calling function inside a function in lua?
In particular, I am looking for (for debugging purposes in the output of a command, for example, print) the possibility of registering when calling a general function indicating where it was called from.
It can only be the name of the file from which it was called, for example,
i.e.
File 1 - Has commonly used function
File 2 - Calls of the the file one functions
PS Dirt - I actually get zero at the same time - is this normal? It is not possible to get more information in this case:
The called file;
SceneBase = {}
function SceneBase:new(options)
end
return SceneBase
The calling file:
require("views.scenes.scene_base")
local scene = SceneBase.new()
source
share