Is lua's debug library implemented in CC? I was hoping to use debug.getinfo to improve traceability.
My code's pretty heavy on the coroutines so when a function parameter is mishandled higher up the stack the default trace usually doesn't cut it. error(_,level) has been helpful but it would be nice to avoid having to throw exceptions whenever there's a problem...
Lua Debug Library in CC?
Started by ArqiTek, Oct 29 2015 03:01 PM
2 replies to this topic
#1
Posted 29 October 2015 - 03:01 PM
#2
Posted 29 October 2015 - 03:23 PM
Nope, the debug API is purposely disabled, as exposing it would break the sandbox's internal walls between the computers.
#3
Posted 29 October 2015 - 03:25 PM
If you are running on a local world, CCTweaks adds an option to enable the debug api (add "debug" to globalWhitelist in the config) - though obviously don't do this on a server.
If you just want to trace, you can get the current function + line through pcall and error:
If you just want to trace, you can get the current function + line through pcall and error:
local _, func = pcall(error, "", 2) -- Or even: print(select(2, pcall(error, "", 2))
Edited by SquidDev, 29 October 2015 - 03:27 PM.
2 user(s) are reading this topic
0 members, 2 guests, 0 anonymous users











