Debug

getinfo

Returns debug metadata for a function or stack level.

Syntax

getinfo(target?: function | number | integer): table
Aliases debug.getinfo

Arguments

NameTypeDescription
target?function | number | integerTarget function, table, stack level, or object being inspected or changed.

Returns

NameTypeDescription
infotableDebug metadata table.

Description

Returns debug metadata for a function or stack level.

Call it with 1 parameter(s): target. The argument table explains which values are required and which ones only refine the behavior.

It returns info (table). Use the returns table to separate successful values from nil results and recoverable errors.

Example

Example call with placeholder values.

local result = getinfo(1)
print(result)