Open naturallymitchell opened 5 years ago
If we can prepend every Lua file Torchbear runs with
log.trace("running: " .. debug.getinfo(1, 'S').source)
Then it'd be much easier to debug.
Since bridge.lua already sends off into the app, I think we'd have to modify the package searcher to basically do standard require(), but just add that one liner ahead of the module to run.
require()
Possible?
or add need, use, or run instead of require
need
use
run
use _require() for original function
_require()
replace the global require function to a function that first logs the required module, and save the original require in _require
_require
If we can prepend every Lua file Torchbear runs with
Then it'd be much easier to debug.
Since bridge.lua already sends off into the app, I think we'd have to modify the package searcher to basically do standard
require()
, but just add that one liner ahead of the module to run.Possible?
or add
need
,use
, orrun
instead of require