Yuari
Documentation
Docs/Debug/debug.getinfo

debug.getinfo

Returns debug information. Global: getinfo.

Syntax

debug.getinfo(funcOrLevel: function | number) -> any

Parameters

ParameterTypeDescription
funcOrLevelfunction | numberThe func or level value used by the call.

Returns

TypeDescription
anyDebug information

Description

debug.getinfo is part of the Debug library. The debug library exposes the internals of the active Luau state, including protos, constants, upvalues and stack frames.

The call is read-only: it resolves the current value when invoked and does not change the underlying state.

Example

local info = debug.getinfo(print)
print(info.name, info.what, info.source)

Notes

  • Writing protos, constants or upvalues can corrupt a running function; test changes carefully.