debug.getinfo
Returns a table of information that's derived from a function or stack level.
debug.getinfo(function: function | number, what: string): tableTable fields: source (definition), short_src (truncated), linedefined (start line), what (\"Lua\", \"C\", \"main\"), name, namewhat (scope), nups (upvalue count), and func (function itself).