Skip to content
Debug libraryOverview

debug.getinfo

Provides descriptive function or frame metadata.

Aliasesgetinfo

Details#

Returns a metadata table for a function or active stack level, including available source, name and line information. Debug names can be absent and line numbers depend on compiled debug information; this is not the function's source text.

Examples#

Example

Luau
local function example() return 42 end
local info = debug.getinfo(example)
for key, value in pairs(info) do print(key, value) end