debug.getinfo
From GMod Wiki
Revision as of 00:25, 19 July 2011 by Colonel Thirty Two (Talk | contribs)
| Function | |
| Syntax |
debug.getinfo( Thread thread or Function func , ... ) Where is this used? |
| Description: | |
|
Returns a table of info about the function you provided, you can also provide a number (a level), 1 being the current function, 2 being the caller, 3 being the caller of the caller, etc You can also specify a second argument, being a mask of the output, for example, if you specify S it will output the source, short_src, what, linedefined and lastlinedefined fields |
|
| Returns: | Table info |
| Part of Library: | Debug |
| Realm: |
|
| BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Debug.getinfo]Debug.getinfo [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
| Description | Prints the file the current function was called from. |
|---|---|
| Used on | |
| Code | print(debug.getinfo(1, "S").short_src) |
| Output | In the console
autorun/debug_test.lua |
See Also
- debug.getinfo on the Lua reference page